/**
 * Logo Guess Challenge Platform - SRM University
 * Premium UI Stylesheet
 * 
 * Design System: Glassmorphism, gradients, micro-animations
 * Colors: SRM Endeavour Blue (#034DA1) + accent gradient
 * Font: Inter (Google Fonts)
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    --primary: #034DA1;
    --primary-light: #4a9eff;
    --primary-dark: #022d60;
    --accent: #6c5ce7;
    --dark: #0a1628;
    --dark-card: #111d33;
    --dark-surface: #162340;
    --light-bg: #f0f4ff;
    --text-light: #e8edf5;
    --text-muted: #8896ab;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg-light: rgba(255, 255, 255, 0.85);
    --glass-border-light: rgba(255, 255, 255, 0.4);
    --gradient-primary: linear-gradient(135deg, #034DA1, #4a9eff);
    --gradient-hero: linear-gradient(135deg, #0a1628 0%, #034DA1 50%, #0a1628 100%);
    --gradient-gold: linear-gradient(135deg, #f7d046, #e8a520);
    --gradient-silver: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    --gradient-bronze: linear-gradient(135deg, #cd7f32, #e8a520);
    --gradient-success: linear-gradient(135deg, #00b894, #00cec9);
    --gradient-danger: linear-gradient(135deg, #e17055, #d63031);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 8px 32px rgba(74, 158, 255, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   GLOBAL RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-bg);
    color: #1a1a2e;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--dark);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* ============================================
   AUTH PAGES (Login, Register, Forgot Password)
   ============================================ */
.auth-page {
    min-height: 100vh;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(74, 158, 255, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite reverse;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

.auth-card .logo-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #4a9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    color: var(--text-muted);
    text-align: center;
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-card .form-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 6px;
}

.auth-card .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    transition: var(--transition);
}

.auth-card .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
    color: #fff;
}

.auth-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-card .input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    border-right: none;
}

.auth-card .input-group .form-control {
    border-left: none;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
}

.auth-links a {
    color: var(--primary-light);
    font-size: 14px;
}

.auth-links a:hover {
    color: #fff;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary-gradient {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.btn-primary-gradient:active {
    transform: translateY(0);
}

.btn-primary-gradient.btn-block {
    width: 100%;
    display: block;
}

/* Ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline-glass {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: var(--transition);
}

.btn-outline-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ============================================
   NAVBAR (User)
   ============================================ */
.navbar-custom {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    font-size: 20px;
    background: linear-gradient(135deg, #fff, #4a9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-custom .nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

.navbar-custom .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
}

.navbar-custom .navbar-toggler-icon {
    filter: invert(1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-right: 8px;
}

/* ============================================
   USER DASHBOARD
   ============================================ */
.dashboard-page {
    background: var(--gradient-hero);
    min-height: 100vh;
}

.dashboard-header {
    padding: 40px 0 20px;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Game Cards */
.game-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(74, 158, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(74, 158, 255, 0.1);
}

.game-card .card-banner {
    height: 180px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.game-card .card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.game-card:hover .card-banner img {
    transform: scale(1.05);
}

.game-card .card-banner .banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(10, 22, 40, 0.9), transparent);
}

.game-card .card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-card .card-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.game-card .card-text {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    flex: 1;
}

.game-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.game-stat-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-stat-badge i {
    color: var(--primary-light);
    font-size: 11px;
}

.game-card .btn-play {
    background: var(--gradient-primary);
    border: none;
    padding: 12px 0;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.game-card .btn-play:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.game-card .btn-play.disabled,
.game-card .btn-play:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.game-card .btn-results {
    background: rgba(0, 184, 148, 0.15);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: #00b894;
    padding: 10px 0;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    width: 100%;
    text-align: center;
    display: block;
    margin-top: 8px;
    transition: var(--transition);
}

.game-card .btn-results:hover {
    background: rgba(0, 184, 148, 0.25);
}

.played-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 184, 148, 0.9);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* ============================================
   QUIZ PAGE
   ============================================ */
.quiz-page {
    background: var(--gradient-hero);
    min-height: 100vh;
}

/* Video Section */
.video-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-container iframe,
.video-container video {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: default;
}

/* Countdown Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.countdown-number {
    font-size: 160px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: countdownPulse 1s ease-in-out;
    text-shadow: 0 0 60px rgba(74, 158, 255, 0.3);
}

@keyframes countdownPulse {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Quiz Timer */
.quiz-timer {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 184, 148, 0.5);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    z-index: 1040;
    text-align: center;
    min-width: 120px;
    transition: var(--transition);
}

.quiz-timer .timer-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.quiz-timer .timer-value {
    font-size: 32px;
    font-weight: 700;
    color: #00b894;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.quiz-timer.timer-warning {
    border-color: rgba(253, 203, 110, 0.6);
}
.quiz-timer.timer-warning .timer-value {
    color: #fdcb6e;
}

.quiz-timer.timer-danger {
    border-color: rgba(225, 112, 85, 0.6);
}
.quiz-timer.timer-danger .timer-value {
    color: #e17055;
}

.quiz-timer.timer-critical {
    border-color: rgba(214, 48, 49, 0.8);
    animation: timerPulse 0.5s ease-in-out infinite;
}
.quiz-timer.timer-critical .timer-value {
    color: #d63031;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(214, 48, 49, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 4px rgba(214, 48, 49, 0.2); }
}

/* Selection Counter */
.selection-counter {
    position: fixed;
    top: 80px;
    left: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    z-index: 1040;
    text-align: center;
}

.selection-counter .counter-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.selection-counter .counter-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-light);
    font-variant-numeric: tabular-nums;
}

/* Quiz Options Grid */
.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 20px 0;
}

.quiz-option {
    background: var(--glass-bg);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.quiz-option:hover {
    border-color: rgba(74, 158, 255, 0.3);
    background: rgba(74, 158, 255, 0.08);
}

.quiz-option.selected {
    border-color: var(--primary-light);
    background: rgba(74, 158, 255, 0.15);
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.1);
}

.quiz-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.quiz-option .option-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.quiz-option.selected .option-checkbox {
    background: var(--gradient-primary);
    border-color: var(--primary-light);
}

.quiz-option.selected .option-checkbox::after {
    content: '✓';
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.quiz-option .option-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: 14px;
}

/* ============================================
   RESULTS PAGE
   ============================================ */
.result-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    animation: slideUp 0.6s ease-out;
}

.result-score {
    font-size: 72px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin: 16px 0;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.result-stat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
}

.result-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.result-stat .stat-label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.result-stat.correct .stat-value { color: #00b894; }
.result-stat.wrong .stat-value { color: #e17055; }
.result-stat.rank .stat-value { color: #fdcb6e; }

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-page {
    background: var(--gradient-hero);
    min-height: 100vh;
}

/* Podium - Top 3 */
.podium-section {
    padding: 40px 0;
    text-align: center;
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin: 40px auto;
    max-width: 600px;
}

.podium-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px;
    text-align: center;
    flex: 1;
    transition: var(--transition);
    position: relative;
}

.podium-card.gold {
    border-color: rgba(247, 208, 70, 0.4);
    order: 2;
    padding-bottom: 40px;
    background: linear-gradient(180deg, rgba(247, 208, 70, 0.12), var(--glass-bg));
}

.podium-card.silver {
    border-color: rgba(192, 192, 192, 0.3);
    order: 1;
    padding-bottom: 24px;
}

.podium-card.bronze {
    border-color: rgba(205, 127, 50, 0.3);
    order: 3;
    padding-bottom: 16px;
}

.podium-rank {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    margin-bottom: 12px;
}

.podium-card.gold .podium-rank {
    background: var(--gradient-gold);
    box-shadow: 0 4px 20px rgba(247, 208, 70, 0.4);
}

.podium-card.silver .podium-rank {
    background: var(--gradient-silver);
    color: #333;
}

.podium-card.bronze .podium-rank {
    background: var(--gradient-bronze);
}

.podium-name {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    word-break: break-word;
}

.podium-score {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 24px;
}

.podium-detail {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Leaderboard Table */
.leaderboard-table {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-table table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.leaderboard-table td {
    padding: 14px 20px;
    color: var(--text-light);
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leaderboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table .rank-cell {
    font-weight: 700;
    color: var(--primary-light);
    width: 60px;
}

.leaderboard-table .score-cell {
    font-weight: 700;
    color: #00b894;
}

/* ============================================
   WINNER REVEAL
   ============================================ */
.reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.reveal-countdown {
    font-size: 200px;
    font-weight: 900;
    color: #fff;
    opacity: 0;
    animation: revealCount 1s forwards;
}

@keyframes revealCount {
    0% { transform: scale(3); opacity: 0; }
    30% { opacity: 1; }
    70% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0; }
}

.reveal-text {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldPulse 2s ease-in-out infinite;
}

@keyframes goldPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

.winner-card-reveal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(247, 208, 70, 0.4);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    animation: winnerReveal 0.8s ease-out forwards;
    opacity: 0;
    max-width: 400px;
    width: 90%;
}

@keyframes winnerReveal {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.winner-card-reveal .winner-name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 16px 0 8px;
}

.winner-card-reveal .winner-score {
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spotlight {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(247, 208, 70, 0.3), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    animation: spotlightMove 4s ease-in-out infinite;
}

@keyframes spotlightMove {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* ============================================
   ADMIN SIDEBAR
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: var(--dark);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    padding: 0;
    overflow-y: auto;
    transition: var(--transition);
}

.admin-sidebar .sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar .sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #4a9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-sidebar .sidebar-subtitle {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-sidebar .nav-section {
    padding: 16px 12px 8px;
}

.admin-sidebar .nav-section-title {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px 8px;
}

.admin-sidebar .nav-item {
    margin: 2px 0;
}

.admin-sidebar .nav-link {
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.admin-sidebar .nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(3, 77, 161, 0.3);
}

.admin-content {
    margin-left: 280px;
    flex: 1;
    background: var(--dark-card);
    min-height: 100vh;
    min-width: 0; /* Prevents flex child from overflowing */
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-topbar {
    background: var(--dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.admin-topbar .page-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.admin-main {
    padding: 32px;
}

/* ============================================
   ADMIN STATS CARDS
   ============================================ */
.stat-card {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74, 158, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.stat-icon.bg-primary { background: var(--gradient-primary); }
.stat-icon.bg-success { background: var(--gradient-success); }
.stat-icon.bg-warning { background: linear-gradient(135deg, #fdcb6e, #e8a520); }
.stat-icon.bg-danger { background: var(--gradient-danger); }
.stat-icon.bg-info { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }

/* ============================================
   ADMIN DATA TABLES
   ============================================ */
.data-table-card {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table-card .card-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.data-table-card .card-header h5 {
    color: #fff;
    font-weight: 600;
    margin: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 20px;
    color: var(--text-light);
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.data-table .actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Admin badges */
.badge-active {
    background: rgba(0, 184, 148, 0.15);
    color: #00b894;
    border: 1px solid rgba(0, 184, 148, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-inactive {
    background: rgba(225, 112, 85, 0.15);
    color: #e17055;
    border: 1px solid rgba(225, 112, 85, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-published {
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
    border: 1px solid rgba(108, 92, 231, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   ADMIN FORMS
   ============================================ */
.admin-form-card {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.admin-form-card .form-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 6px;
}

.admin-form-card .form-control,
.admin-form-card .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    transition: var(--transition);
}

.admin-form-card .form-control:focus,
.admin-form-card .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
    color: #fff;
}

.admin-form-card .form-control::placeholder {
    color: var(--text-muted);
}

.admin-form-card textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--gradient-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-box {
    position: relative;
}

.search-box .form-control {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: #fff;
    padding: 10px 16px 10px 44px;
    font-size: 14px;
}

.search-box .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================
   SKELETON LOADER
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.04) 25%, 
        rgba(255,255,255,0.08) 50%, 
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.skeleton-banner {
    height: 180px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.04) 25%, 
        rgba(255,255,255,0.08) 50%, 
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 16px;
    margin: 12px 24px;
    border-radius: 8px;
}

.skeleton-text.short { width: 60%; }

/* ============================================
   LOADING & SPINNER
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

.spinner-dots {
    display: flex;
    gap: 8px;
}

.spinner-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.spinner-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.spinner-dots .dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-custom {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-custom .progress-bar {
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container-custom {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-custom {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: #fff;
    font-size: 14px;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-custom.success { border-left: 3px solid #00b894; }
.toast-custom.error { border-left: 3px solid #d63031; }
.toast-custom.warning { border-left: 3px solid #fdcb6e; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   RULES MODAL
   ============================================ */
.rules-modal .modal-content {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    color: #fff;
}

.rules-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px 32px;
}

.rules-modal .modal-title {
    font-weight: 700;
    font-size: 20px;
}

.rules-modal .modal-body {
    padding: 24px 32px;
}

.rules-modal .rule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
}

.rules-modal .rule-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.rules-modal .rule-text {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.rules-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 32px;
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 40px;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px rgba(74, 158, 255, 0.3);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
    display: block;
}

.empty-state h5 {
    color: var(--text-light);
    margin-bottom: 8px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-card {
        width: 100%;
        max-width: 300px;
    }
    
    .podium-card.gold { order: 1; }
    .podium-card.silver { order: 2; }
    .podium-card.bronze { order: 3; }
}

@media (max-width: 767px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }
    
    .quiz-timer {
        top: auto;
        bottom: 16px;
        right: 16px;
        padding: 12px 16px;
        min-width: auto;
    }
    
    .quiz-timer .timer-value {
        font-size: 24px;
    }
    
    .selection-counter {
        top: auto;
        bottom: 16px;
        left: 16px;
        padding: 12px 16px;
    }
    
    .selection-counter .counter-value {
        font-size: 18px;
    }
    
    .quiz-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .quiz-option {
        padding: 12px 14px;
    }
    
    .admin-main {
        padding: 16px;
    }
    
    .admin-topbar {
        padding: 12px 16px;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }
    
    .result-score {
        font-size: 48px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .game-card .card-banner {
        height: 140px;
    }
}

@media (max-width: 575px) {
    .quiz-options-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ============================================
   MOBILE SIDEBAR TOGGLE
   ============================================ */
.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
}

@media (max-width: 991px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1049;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
}

/* ============================================
   CSV IMPORT
   ============================================ */
.csv-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.csv-upload-zone:hover,
.csv-upload-zone.dragover {
    border-color: var(--primary-light);
    background: rgba(74, 158, 255, 0.05);
}

.csv-upload-zone i {
    font-size: 48px;
    color: var(--primary-light);
    margin-bottom: 12px;
}

.csv-upload-zone p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-card {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.chart-card h6 {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 20px;
}

/* ============================================
   PENDING RESULTS MESSAGE
   ============================================ */
.pending-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(253, 203, 110, 0.3);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.pending-card i {
    font-size: 64px;
    color: #fdcb6e;
    margin-bottom: 16px;
}

.pending-card h4 {
    color: #fff;
    margin-bottom: 8px;
}

.pending-card p {
    color: var(--text-muted);
}

/* ============================================
   IMAGE PREVIEW
   ============================================ */
.img-preview {
    max-width: 200px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-custom .page-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: var(--radius-sm) !important;
    font-size: 13px;
    transition: var(--transition);
}

.pagination-custom .page-link:hover {
    background: rgba(74, 158, 255, 0.15);
    border-color: var(--primary-light);
    color: #fff;
}

.pagination-custom .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
}
