/**
 * style.css – VinylKids Collector
 * Episches Retro-Vinyl Design: Dark Mode + Neon-Akzente
 */

/* ===== Variablen ===== */
:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --text-main: #e0e0e0;
    --text-muted: #888;
    --neon-pink: #ff2d95;
    --neon-cyan: #00f5ff;
    --neon-green: #39ff14;
    --neon-yellow: #ffe600;
    --neon-pink-glow: 0 0 10px #ff2d95, 0 0 30px #ff2d9555;
    --neon-cyan-glow: 0 0 10px #00f5ff, 0 0 30px #00f5ff55;
    --neon-green-glow: 0 0 10px #39ff14, 0 0 30px #39ff1455;
    --radius: 12px;
    --font-main: 'Montserrat', sans-serif;
    --font-retro: 'Press Start 2P', cursive;
}

/* ===== Reset & Basis ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--neon-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ===== Header ===== */
.app-header {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 100%);
    border-bottom: 2px solid var(--neon-pink);
    box-shadow: var(--neon-pink-glow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-text {
    font-family: var(--font-retro);
    font-size: 0.85rem;
    color: var(--neon-pink);
    text-shadow: var(--neon-pink-glow);
    cursor: pointer;
    white-space: nowrap;
}

.back-link {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--neon-cyan);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-input, .sort-select {
    background: var(--bg-input);
    border: 1px solid #333;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-main);
}

.filter-input { width: 140px; }
.filter-input:focus, .sort-select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: var(--neon-cyan-glow);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-neon {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: var(--neon-pink-glow);
}
.btn-neon:hover {
    background: #e0267f;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
}
.btn-outline:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    text-decoration: none;
}

.btn-small { padding: 6px 12px; font-size: 0.8rem; }
.btn-large { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-danger {
    background: #c0392b;
    color: #fff;
}
.btn-danger:hover { background: #a93226; }

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--neon-pink);
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--neon-pink-glow), 0 4px 20px rgba(0,0,0,0.5);
    z-index: 200;
    transition: transform 0.2s;
    text-decoration: none;
    line-height: 1;
}
.fab:hover {
    transform: scale(1.1) rotate(90deg);
    text-decoration: none;
}

/* ===== Collection Grid ===== */
.collection-grid {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.record-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #222;
}
.record-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--neon-cyan-glow);
    border-color: var(--neon-cyan);
}

.record-card .card-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #111;
}

.record-card .card-cover-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #333;
}

.record-card .card-info {
    padding: 10px;
}

.record-card .card-artist {
    font-size: 0.75rem;
    color: var(--neon-cyan);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-card .card-title {
    font-size: 0.85rem;
    font-weight: 900;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-card .card-year {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Record Count ===== */
.record-count {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 4rem; display: block; margin-bottom: 16px; }

/* ===== Detail Page ===== */
.detail-page {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #111;
}

.detail-cover-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: #333;
}

.detail-meta {
    padding: 20px 16px;
}

.detail-artist {
    font-size: 0.85rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 4px 0 12px;
}

.detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-pink { background: var(--neon-pink); color: #fff; }
.badge-cyan { background: var(--neon-cyan); color: #000; }
.badge-green { background: var(--neon-green); color: #000; }
.badge-dark { background: #333; color: var(--text-main); }

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.info-item label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.info-item span {
    font-size: 0.9rem;
    font-weight: 700;
}

/* ===== Tracklist (Detail) ===== */
.tracklist-section {
    margin-top: 24px;
    background: #111;
    border-radius: var(--radius);
    border: 1px solid #222;
    overflow: hidden;
}

.tracklist-header {
    padding: 14px 16px;
    font-family: var(--font-retro);
    font-size: 0.6rem;
    color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #222;
}

.tracklist-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #1a1a1a;
    transition: background 0.15s;
}
.tracklist-item:last-child { border-bottom: none; }
.tracklist-item:hover { background: #1a1a2e; }

.track-pos {
    width: 36px;
    font-size: 0.75rem;
    color: var(--neon-pink);
    font-weight: 700;
    flex-shrink: 0;
}

.track-title {
    flex: 1;
    font-size: 0.85rem;
}

.track-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 12px;
    flex-shrink: 0;
}

/* ===== Notes ===== */
.detail-notes {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    white-space: pre-wrap;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 0 16px;
}

/* ===== Add Page ===== */
.add-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.section-title {
    font-family: var(--font-retro);
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #222;
}
.neon-pink { color: var(--neon-pink); text-shadow: var(--neon-pink-glow); }
.neon-cyan { color: var(--neon-cyan); text-shadow: var(--neon-cyan-glow); }
.neon-green { color: var(--neon-green); text-shadow: var(--neon-green-glow); }

.scanner-section, .search-section, .results-section, .form-section, .manual-section {
    margin-bottom: 28px;
}

/* ===== Video / Scanner ===== */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 12px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    aspect-ratio: 4 / 3;
    display: none;
}
.video-wrapper.active { display: block; }

#scannerVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    border: 2px solid var(--neon-green);
    border-radius: var(--radius);
    pointer-events: none;
}

.scan-line {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--neon-green);
    box-shadow: var(--neon-green-glow);
    animation: scanPulse 1.5s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { opacity: 0.3; transform: translateY(-20px); }
    50% { opacity: 1; transform: translateY(20px); }
}

.scanner-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.scan-status {
    text-align: center;
    font-size: 0.85rem;
    color: var(--neon-green);
    min-height: 24px;
}

/* ===== Search ===== */
.search-bar {
    display: flex;
    gap: 8px;
}

.input-full {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: var(--font-main);
}
.input-full:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: var(--neon-cyan-glow);
}

textarea.input-full { resize: vertical; }

.input-file {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Results ===== */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    border: 1px solid #222;
    transition: border-color 0.2s;
}
.result-item:hover {
    border-color: var(--neon-cyan);
}

.result-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #111;
    flex-shrink: 0;
}

.result-info { flex: 1; min-width: 0; }
.result-info strong {
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Form ===== */
.record-form { margin-top: 8px; }

.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-cover-preview {
    text-align: center;
    margin-bottom: 16px;
}
.form-cover-preview img {
    max-width: 200px;
    border-radius: var(--radius);
    margin: 0 auto;
    border: 2px solid var(--neon-pink);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ===== Tracklist-Edit ===== */
.tracklist-edit {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.track-row {
    display: grid;
    grid-template-columns: 50px 1fr 70px 32px;
    gap: 6px;
    align-items: center;
}

.track-row input {
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid #333;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.8rem;
    font-family: var(--font-main);
}

.track-row .btn-remove-track {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ===== Login ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d0d 70%);
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 12px;
    animation: vinylSpin 4s linear infinite;
}

@keyframes vinylSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.neon-title {
    font-family: var(--font-retro);
    font-size: 1rem;
    color: var(--neon-pink);
    text-shadow: var(--neon-pink-glow);
    line-height: 1.6;
}
.neon-sub {
    color: var(--neon-cyan);
    text-shadow: var(--neon-cyan-glow);
    font-size: 0.7rem;
}

.login-form .input-group {
    margin-bottom: 16px;
}

.login-form input {
    width: 100%;
    padding: 14px;
    background: var(--bg-input);
    border: 2px solid #333;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: var(--font-main);
}
.login-form input:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: var(--neon-pink-glow);
}

.login-form .btn { width: 100%; padding: 14px; font-size: 1rem; }

.error-msg {
    background: #c0392b33;
    border: 1px solid #c0392b;
    color: #ff6b6b;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-align: center;
}

/* ===== Loader ===== */
.loader {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neon-green);
    color: #000;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    box-shadow: var(--neon-green-glow);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===== Responsive ===== */
@media (min-width: 480px) {
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 768px) {
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    .logo-text { font-size: 1rem; }
    .filter-input { width: 200px; }
}

@media (max-width: 400px) {
    .header-actions { width: 100%; }
    .filter-input { flex: 1; }
    .form-row { grid-template-columns: 1fr; }
    .detail-info-grid { grid-template-columns: 1fr; }
}
