/* =============================================================================
   HKA LEARNING KIDS — Main Stylesheet
   Design: Colorful, playful, child-friendly, fully responsive
   Inspired by: Kahoot, Quizizz, Duolingo
   ============================================================================= */

/* =============================================================================
   CSS VARIABLES (Design Tokens)
   ============================================================================= */
:root {
    /* Primary Colors */
    --color-primary: #6C5CE7;
    --color-primary-light: #A29BFE;
    --color-primary-dark: #5A4BD1;

    /* Accent Colors */
    --color-accent: #FF6B35;
    --color-accent-light: #FF8F66;
    --color-accent-dark: #E55A28;

    /* Fun Colors */
    --color-fun-green: #00B894;
    --color-fun-blue: #0984E3;
    --color-fun-pink: #FD79A8;
    --color-fun-yellow: #FDCB6E;
    --color-fun-red: #E17055;
    --color-fun-purple: #A29BFE;
    --color-fun-teal: #00CEC9;
    --color-fun-orange: #E17055;

    /* Neutral Colors */
    --color-bg: #F8F9FF;
    --color-bg-card: #FFFFFF;
    --color-bg-dark: #2D3436;
    --color-text: #2D3436;
    --color-text-light: #636E72;
    --color-text-muted: #B2BEC3;
    --color-border: #DFE6E9;

    /* Status */
    --color-success: #00B894;
    --color-warning: #FDCB6E;
    --color-error: #E17055;
    --color-info: #0984E3;

    /* Fonts */
    --font-main: 'Nunito', sans-serif;
    --font-display: 'Fredoka One', cursive;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 20px rgba(108,92,231,0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Container */
    --container-max: 1200px;
    --navbar-height: 70px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

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

ul {
    list-style: none;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    z-index: 1000;
    transition: top var(--transition-fast);
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* =============================================================================
   CONTAINER
   ============================================================================= */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* =============================================================================
   NAVBAR
   ============================================================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--color-border);
    height: var(--navbar-height);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-primary);
    white-space: nowrap;
}

.brand-icon {
    font-size: 1.8rem;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.navbar-links {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--color-primary-light);
    color: white;
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--color-primary);
    color: white;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    color: white !important;
    padding: var(--space-xs) var(--space-md) !important;
    border-radius: var(--radius-xl) !important;
}

.user-avatar {
    font-size: 1.3rem;
}

.user-points {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.hamburger {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--color-text);
    border-radius: 3px;
    position: relative;
    transition: var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 3px;
    background: var(--color-text);
    border-radius: 3px;
    transition: var(--transition-fast);
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: white;
}

.btn-accent:hover {
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-fun-green), #00a884);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

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

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* =============================================================================
   ALERTS / MESSAGES
   ============================================================================= */
.messages-container {
    position: fixed;
    top: calc(var(--navbar-height) + 10px);
    right: var(--space-lg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
}

.alert-success { background: #D4EDDA; color: #155724; border-left: 4px solid var(--color-success); }
.alert-info { background: #D1ECF1; color: #0C5460; border-left: 4px solid var(--color-info); }
.alert-warning { background: #FFF3CD; color: #856404; border-left: 4px solid var(--color-warning); }
.alert-error, .alert-danger { background: #F8D7DA; color: #721C24; border-left: 4px solid var(--color-error); }

.alert-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0 0 var(--space-md);
}

.alert-close:hover { opacity: 1; }

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

/* =============================================================================
   HERO SECTION
   ============================================================================= */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #A29BFE 50%, var(--color-fun-teal) 100%);
    color: white;
    padding: var(--space-3xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--space-md);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: var(--space-xl);
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    display: block;
}

.hero-stat-label {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Floating decorations */
.hero-decoration {
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

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

/* =============================================================================
   SECTION
   ============================================================================= */
.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.section-header p {
    color: var(--color-text-light);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =============================================================================
   CARDS — Category Cards
   ============================================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.card-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    display: block;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.card-description {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--color-bg);
}

.card-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* Category cards */
.category-card {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
}

.category-card .card-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
}

.category-card:hover .card-icon {
    transform: scale(1.1);
    transition: transform var(--transition-fast);
}

/* Game cards */
.game-card {
    display: flex;
    flex-direction: column;
}

.game-card .card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.game-card .game-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.game-card .card-body {
    flex: 1;
}

.game-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 700;
}

.difficulty-1 { background: #D4EDDA; color: #155724; }
.difficulty-2 { background: #FFF3CD; color: #856404; }
.difficulty-3 { background: #F8D7DA; color: #721C24; }

/* =============================================================================
   BADGES
   ============================================================================= */
.badge-card {
    text-align: center;
    padding: var(--space-lg);
}

.badge-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(80%);
}

.badge-card.locked:hover {
    opacity: 0.7;
    filter: grayscale(50%);
}

.badge-rarity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: var(--space-xs);
}

.rarity-common { background: #E8F5E9; color: #2E7D32; }
.rarity-rare { background: #E3F2FD; color: #1565C0; }
.rarity-epic { background: #F3E5F5; color: #7B1FA2; }
.rarity-legendary { background: #FFF8E1; color: #F57F17; }

/* =============================================================================
   FORMS
   ============================================================================= */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    background: white;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-error {
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    max-width: 480px;
    margin: 0 auto;
}

.form-card h2 {
    font-family: var(--font-display);
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--color-primary);
}

/* =============================================================================
   GAME PLAY AREA
   ============================================================================= */
.game-play {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.game-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-fun-teal));
    border-radius: var(--radius-xl);
    transition: width var(--transition-normal);
}

.progress-text {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.question-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.question-number {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-sm);
}

.question-text {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: var(--space-xl);
    line-height: 1.4;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.answer-btn {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 3px solid var(--color-border);
    background: white;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: white;
    transform: scale(1.02);
}

.answer-btn.correct {
    border-color: var(--color-success);
    background: var(--color-success);
    color: white;
    animation: pulse 0.5s ease;
}

.answer-btn.wrong {
    border-color: var(--color-error);
    background: var(--color-error);
    color: white;
    animation: shake 0.5s ease;
}

.answer-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Feedback */
.feedback {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.feedback-correct {
    background: #D4EDDA;
    color: #155724;
    border-left: 4px solid var(--color-success);
}

.feedback-wrong {
    background: #F8D7DA;
    color: #721C24;
    border-left: 4px solid var(--color-error);
}

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

/* Score / Results */
.results-card {
    text-align: center;
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: var(--space-2xl) auto;
}

.results-score {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.results-label {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-xl);
}

.results-details {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.result-item {
    text-align: center;
}

.result-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-text);
}

.result-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* =============================================================================
   PROFILE
   ============================================================================= */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-2xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-xl);
}

.profile-avatar {
    font-size: 4rem;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    border: 3px solid var(--color-primary-light);
}

.profile-info h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
}

.profile-level {
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: var(--space-xs);
}

/* =============================================================================
   FILTERS BAR
   ============================================================================= */
.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-label {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-select {
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-weight: 600;
    background: white;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.footer {
    background: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer h4 {
    color: white;
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

.footer-small {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: var(--space-sm);
}

.footer ul li {
    margin-bottom: var(--space-sm);
}

.footer a {
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.footer a:hover {
    opacity: 1;
    color: var(--color-primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-lg);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    font-family: var(--font-display);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
}

/* =============================================================================
   TIMER
   ============================================================================= */
.timer {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
}

.timer.warning {
    color: var(--color-warning);
}

.timer.danger {
    color: var(--color-error);
    animation: pulse 1s infinite;
}

/* =============================================================================
   RESPONSIVE — Tablet (< 768px)
   ============================================================================= */
@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        flex-direction: column;
        padding: var(--space-xl);
        gap: var(--space-lg);
        transform: translateX(100%);
        transition: transform var(--transition-normal);
        z-index: 99;
        overflow-y: auto;
    }

    .navbar-menu.open {
        transform: translateX(0);
    }

    .navbar-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        padding: var(--space-md);
        font-size: 1.1rem;
        justify-content: center;
    }

    .navbar-auth {
        flex-direction: column;
        width: 100%;
    }

    .navbar-auth .btn {
        width: 100%;
    }

    .hero {
        padding: var(--space-2xl) 0;
    }

    .hero-stats {
        gap: var(--space-lg);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-grid-sm {
        grid-template-columns: repeat(2, 1fr);
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .results-details {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* =============================================================================
   RESPONSIVE — Small phone (< 480px)
   ============================================================================= */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .card {
        padding: var(--space-lg);
    }

    .form-card {
        padding: var(--space-lg);
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .card-grid-sm {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================================
   UTILITIES
   ============================================================================= */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-light); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.hidden { display: none !important; }

/* Confetti animation for perfect scores */
@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti 3s ease-out forwards;
    z-index: 300;
    pointer-events: none;
}
