:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #6B7280;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --dark: #1F2937;
    --light: #F9FAFB;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn-primary-grad {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary-grad:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
    color: #fff;
}

.btn-success-grad {
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

/* Navbar */
.navbar-modern {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
}

.navbar-modern .navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid #E5E7EB;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label { font-weight: 600; font-size: 0.9rem; color: #374151; margin-bottom: 0.4rem; }

.input-group-text {
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-sm) !important;
    background: #F9FAFB;
}

/* Auth */
.auth-container {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #C7D2FE 100%);
    min-height: 100vh;
}

.divider {
    border-top: 1px solid #E5E7EB;
    text-align: center;
    position: relative;
}

.divider span {
    position: relative;
    top: -10px;
    background: #fff;
}

/* OTP Input */
.otp-inputs .otp-digit {
    width: 45px;
    height: 52px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid #D1D5DB;
    border-radius: 10px;
}

.otp-inputs .otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Stat Cards */
.stat-card { transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-icon { width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; }
.stat-icon i { font-size: 1.2rem; }

/* Quiz */
.quiz-container { background: #F3F4F6; min-height: 100vh; }
.quiz-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0 0 var(--radius) var(--radius);
}
.question-card { animation: fadeIn 0.3s ease; }
.btn-option {
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    text-align: left;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.btn-option:hover { border-color: var(--primary); background: #EEF2FF; }
.btn-option.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    font-weight: 700;
    font-size: 0.85rem;
}
.btn-option.selected .option-label { background: rgba(255,255,255,0.2); color: #fff; }

.nav-dot {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-progress { border-radius: 10px; overflow: hidden; }

/* Result */
.score-circle { position: relative; display: inline-block; }
.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.review-card { border-left: 4px solid transparent; transition: all 0.2s; }
.review-card:hover { transform: translateX(4px); }

/* Podium */
.bg-bronze { background: #CD7F32; }

/* Leaderboard */
#leaderboardTable tbody tr { transition: all 0.2s; }
#leaderboardTable tbody tr:hover { background: #F3F4F6; transform: scale(1.01); }

/* Achievements */
.achievement-card { transition: all 0.3s; }
.achievement-card.earned:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.achievement-card.locked { opacity: 0.7; filter: grayscale(1); }

/* Main Content */
.main-content { padding-top: 0; }

/* Welcome Card */
.welcome-card { background: linear-gradient(135deg, #EEF2FF, #E0E7FF); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in { animation: fadeIn 0.4s ease; }
.slide-up { animation: slideUp 0.5s ease; }

/* Responsive - Mobile First */
@media (max-width: 576px) {
    .container { padding-left: 16px; padding-right: 16px; }
    h4 { font-size: 1.2rem; }
    .glass-card { padding: 1rem !important; }
    .stat-card h3 { font-size: 1.5rem; }
    .btn-option { padding: 0.7rem 1rem; font-size: 0.9rem; }
    .otp-digit { width: 38px !important; height: 44px !important; font-size: 1.1rem !important; }
    .score-circle canvas { width: 120px !important; height: 120px !important; }
}

@media (min-width: 768px) {
    .auth-container .glass-card { padding: 2.5rem !important; }
}

/* Toast */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; }

/* Rank Display */
.rank-display .display-3 { font-size: 3.5rem; line-height: 1; }

/* Calendar */
.calendar-heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

/* Print */
@media print {
    .navbar, .admin-sidebar, .btn, footer { display: none !important; }
    .glass-card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* Homepage Hero */
.hero-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4F46E5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(129, 140, 248, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(167, 139, 250, 0.1) 0%, transparent 50%);
    animation: heroBg 20s ease infinite;
}

@keyframes heroBg {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-2%, 2%) rotate(-1deg); }
}

/* Footer */
.footer-modern { background: #1F2937; color: #9CA3AF; }
.footer-modern a { color: #9CA3AF; transition: color 0.2s; }
.footer-modern a:hover { color: #fff; }

.social-links .btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }

/* Feature cards */
.feature-card { transition: all 0.3s; border: 1px solid rgba(79, 70, 229, 0.1); }
.feature-card:hover { transform: translateY(-8px); border-color: var(--primary); }

/* Stats counter */
.stat-counter { font-size: 2.5rem; font-weight: 800; }

/* Testimonial */
.testimonial-card { background: #fff; border-radius: var(--radius); }
