/* === HITSCAN - Theme Musical === */

:root {
    --primary: #6C2BD9;
    --primary-dark: #5521B5;
    --primary-light: #9F67FF;
    --secondary: #F59E0B;
    --secondary-dark: #D97706;
    --dark: #1A1A2E;
    --darker: #0F0F1A;
    --light: #E8E8F0;
    --success: #10B981;
    --danger: #EF4444;
    --card-bg: #16213E;
    --card-border: #2A2A4A;
}

/* === Base === */
body {
    background-color: var(--darker);
    color: var(--light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

a { color: var(--primary-light); }
a:hover { color: var(--secondary); }

/* === Navbar === */
.navbar-hitscan {
    background: linear-gradient(135deg, var(--primary-dark), var(--dark));
    border-bottom: 2px solid var(--primary);
    padding: 0.8rem 1rem;
}

.navbar-hitscan .navbar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
}

.navbar-hitscan .navbar-brand span {
    color: var(--secondary);
}

.navbar-hitscan .nav-link {
    color: var(--light);
    font-weight: 500;
}

.navbar-hitscan .nav-link:hover,
.navbar-hitscan .nav-link.active {
    color: var(--secondary);
}

/* === Cards / Panels === */
.card-hitscan {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
}

.card-hitscan .card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-bottom: none;
    color: #fff;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-hitscan .card-body {
    padding: 1.5rem;
}

/* === Buttons === */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 43, 217, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    border: none;
    color: #000;
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    color: #000;
}

/* === Tables (admin) === */
.table-hitscan {
    color: var(--light);
}

.table-hitscan thead th {
    background-color: var(--primary-dark);
    color: #fff;
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
}

.table-hitscan tbody tr {
    border-bottom: 1px solid var(--card-border);
}

.table-hitscan tbody tr:hover {
    background-color: rgba(108, 43, 217, 0.1);
}

/* === Forms === */
.form-control, .form-select {
    background-color: var(--dark);
    border: 1px solid var(--card-border);
    color: var(--light);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background-color: var(--dark);
    border-color: var(--primary);
    color: var(--light);
    box-shadow: 0 0 0 0.2rem rgba(108, 43, 217, 0.25);
}

.form-label {
    color: var(--light);
    font-weight: 500;
}

/* === Timeline (game) === */
.timeline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem;
    overflow-x: auto;
    min-height: 140px;
}

.timeline-card {
    flex-shrink: 0;
    width: 90px;
    height: 120px;
    background: linear-gradient(145deg, var(--card-bg), var(--dark));
    border: 2px solid var(--primary);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    cursor: default;
    transition: all 0.2s;
}

.timeline-card .card-year {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.timeline-card .card-title-small {
    font-size: 0.6rem;
    color: var(--light);
    opacity: 0.8;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.timeline-card .card-artist-small {
    font-size: 0.55rem;
    color: var(--light);
    opacity: 0.6;
}

/* Drop zone between cards */
.timeline-drop {
    flex-shrink: 0;
    width: 40px;
    height: 120px;
    border: 2px dashed var(--card-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.timeline-drop.active {
    opacity: 1;
    border-color: var(--primary-light);
}

.timeline-drop:hover, .timeline-drop.highlight {
    background-color: rgba(108, 43, 217, 0.2);
    border-color: var(--secondary);
    opacity: 1;
}

/* Current song card (to place) */
.current-card {
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    border: 3px solid var(--secondary);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    animation: pulse-glow 2s infinite;
    max-width: 300px;
    margin: 0 auto;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 43, 217, 0.4); }
    50% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.5); }
}

.current-card .qr-placeholder {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Player section */
.player-section {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.player-section.active-player {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.player-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--secondary);
}

.player-score {
    font-size: 0.85rem;
    color: var(--light);
    opacity: 0.7;
}

/* === Scan page === */
.scan-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: radial-gradient(ellipse at center, var(--dark) 0%, var(--darker) 100%);
}

.spotify-player {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* === Homepage === */
.hero-section {
    text-align: center;
    padding: 4rem 1rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .subtitle {
    font-size: 1.2rem;
    color: var(--light);
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* === Stats cards (admin) === */
.stat-card {
    background: linear-gradient(145deg, var(--card-bg), var(--dark));
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--light);
    opacity: 0.7;
}

/* === Result reveal === */
.reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.reveal-card {
    background: linear-gradient(145deg, var(--card-bg), var(--dark));
    border: 3px solid var(--primary);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    animation: reveal-in 0.5s ease-out;
}

.reveal-card.correct { border-color: var(--success); }
.reveal-card.wrong { border-color: var(--danger); }

.reveal-card .reveal-year {
    font-size: 4rem;
    font-weight: 900;
    color: var(--secondary);
}

.reveal-card .reveal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.5rem;
}

.reveal-card .reveal-artist {
    font-size: 1rem;
    color: var(--light);
    opacity: 0.8;
}

.reveal-card .reveal-result {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 1.5rem;
}

.reveal-card .reveal-result.correct { color: var(--success); }
.reveal-card .reveal-result.wrong { color: var(--danger); }

@keyframes reveal-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* === Print styles for cards === */
.print-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 2rem;
    padding: 10mm;
    background: #fff;
    color: #000;
    page-break-after: always;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    height: calc(297mm - 20mm);
}

.print-card {
    border: 1px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5mm;
    position: relative;
}

/* Recto: QR code */
.print-card-recto .qr-code {
    width: 40mm;
    height: 40mm;
}

.print-card-recto .card-number {
    position: absolute;
    bottom: 3mm;
    font-size: 8pt;
    color: #999;
}

/* Verso: Song info */
.print-card-verso {
    text-align: center;
}

.print-card-verso .verso-year {
    font-size: 48pt;
    font-weight: 900;
    color: #000;
    line-height: 1;
    margin: 5mm 0;
}

.print-card-verso .verso-title {
    font-size: 11pt;
    font-weight: 700;
    color: #333;
    margin-bottom: 2mm;
}

.print-card-verso .verso-artist {
    font-size: 10pt;
    color: #666;
}

/* Crop marks */
.print-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 0.5px dashed #ccc;
    pointer-events: none;
}

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        margin: 0;
        padding: 0;
    }

    .no-print { display: none !important; }

    .print-page {
        margin: 0;
        padding: 10mm;
        box-shadow: none;
        page-break-after: always;
    }

    .print-card {
        border: 0.5px dashed #ccc;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 2rem; }
    .timeline { gap: 4px; }
    .timeline-card { width: 70px; height: 100px; }
    .timeline-card .card-year { font-size: 1.2rem; }
}

/* === Alert messages === */
.alert-hitscan {
    background-color: var(--card-bg);
    border: 1px solid var(--primary);
    color: var(--light);
    border-radius: 10px;
}

/* === Badge === */
.badge-year {
    background-color: var(--secondary);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.3em 0.6em;
    border-radius: 6px;
}

/* === Pagination === */
.page-link {
    background-color: var(--card-bg);
    border-color: var(--card-border);
    color: var(--light);
}

.page-link:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* === Card mode reveal (inline) === */
.reveal-card-inline {
    background: linear-gradient(145deg, var(--card-bg), var(--dark));
    border: 3px solid var(--secondary);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 400px;
    margin: 0 auto;
    animation: reveal-in 0.5s ease-out;
}

/* === Winner === */
.winner-banner {
    text-align: center;
    padding: 3rem;
    animation: winner-glow 1.5s infinite alternate;
}

.winner-banner h2 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--secondary);
}

@keyframes winner-glow {
    from { text-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
    to { text-shadow: 0 0 40px rgba(245, 158, 11, 0.9); }
}

/* === Leaderboard / Hall of Fame === */
.leaderboard-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary);
}

.leaderboard-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.9rem;
}

.rank-gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.rank-silver { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.rank-bronze { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; }

/* Podium */
.podium-container {
    display: flex;
    justify-content: center;
}

.podium {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.podium-step {
    text-align: center;
    width: 160px;
}

.podium-medal {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.podium-1 .podium-medal { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.podium-2 .podium-medal { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.podium-3 .podium-medal { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; }

.podium-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 4px;
}

.podium-stats {
    font-size: 0.85rem;
    color: var(--light);
    opacity: 0.7;
    margin-bottom: 8px;
}

.podium-bar {
    border-radius: 8px 8px 0 0;
    width: 100%;
}

.podium-bar-1 { height: 120px; background: linear-gradient(to top, #FFD700, #FFA500); }
.podium-bar-2 { height: 80px; background: linear-gradient(to top, #C0C0C0, #A0A0A0); }
.podium-bar-3 { height: 50px; background: linear-gradient(to top, #CD7F32, #8B4513); }

.table-active {
    background-color: rgba(108, 43, 217, 0.15) !important;
}

/* === Team Members === */
.team-member-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.team-member-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--card-border);
}

.team-member-list li:last-child {
    border-bottom: none;
}

.team-member-list .member-name {
    color: var(--light);
    font-weight: 500;
}

.team-member-list .btn-remove {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.team-member-list .btn-remove:hover {
    opacity: 1;
}
