/* GoLearni - Adaptive Learning Platform */

/* ===== Variables & Themes ===== */
:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #C8E6C9;
    --secondary: #2196F3;
    --secondary-dark: #1565C0;
    --accent: #FF9800;
    --accent-dark: #F57C00;
    --danger: #F44336;
    --success: #4CAF50;
    --warning: #FFC107;

    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --bg-card: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;

    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size: 16px;
    --nav-height: 64px;

    --anim-intensity: 1;
}

/* Theme: Groep 1-2 (Kleuters) */
.theme-kleuters {
    --primary: #FF6B9D;
    --primary-dark: #E91E63;
    --primary-light: #FCE4EC;
    --secondary: #AB47BC;
    --accent: #FFB74D;
    --bg-alt: #FFF8F0;
    --font-size: 24px;
    --radius: 24px;
    --radius-sm: 16px;
    --anim-intensity: 1.5;
}

/* Theme: Groep 3-4 (Onderbouw) */
.theme-onderbouw {
    --primary: #42A5F5;
    --primary-dark: #1E88E5;
    --primary-light: #BBDEFB;
    --secondary: #66BB6A;
    --accent: #FFCA28;
    --bg-alt: #F3F8FF;
    --font-size: 20px;
    --radius: 16px;
    --anim-intensity: 1.3;
}

/* Theme: Groep 5-6 (Middenbouw) */
.theme-middenbouw {
    --primary: #26A69A;
    --primary-dark: #00897B;
    --primary-light: #B2DFDB;
    --secondary: #5C6BC0;
    --accent: #FF7043;
    --bg-alt: #F0FAF9;
    --font-size: 17px;
    --anim-intensity: 0.8;
}

/* Theme: Groep 7-8 (Bovenbouw) */
.theme-bovenbouw {
    --primary: #5C6BC0;
    --primary-dark: #3F51B5;
    --primary-light: #C5CAE9;
    --secondary: #26A69A;
    --accent: #FFA726;
    --bg-alt: #F5F5FA;
    --font-size: 16px;
    --radius: 10px;
    --radius-sm: 6px;
    --anim-intensity: 0.5;
}

/* ===== Base ===== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

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

html {
    scroll-behavior: smooth;
}

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

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

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

/* ===== Animated Background Gradient ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(76,175,80,0.03) 0%,
        rgba(33,150,243,0.03) 25%,
        rgba(255,152,0,0.03) 50%,
        rgba(156,39,176,0.03) 75%,
        rgba(76,175,80,0.03) 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    z-index: -2;
    pointer-events: none;
    will-change: background-position;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* ===== Floating Background Shapes ===== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,107,155,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(66,165,245,0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,183,77,0.04) 0%, transparent 60%);
    animation: floatingBg 15s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
    will-change: transform;
}

@keyframes floatingBg {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 15px) scale(1.05); }
    100% { transform: translate(10px, -10px) scale(1); }
}

/* ===== Utilities ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ===== Keyframe Animations ===== */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(76,175,80,0.3); }
    50% { box-shadow: 0 0 20px rgba(76,175,80,0.6), 0 0 40px rgba(76,175,80,0.2); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px); }
    20% { transform: translateX(10px); }
    30% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    90% { transform: translateX(-1px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes starRain {
    0% { transform: translateY(-100vh) rotate(0deg) scale(0); opacity: 1; }
    50% { transform: translateY(50vh) rotate(360deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes rainbowGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes cardFlip {
    0% { transform: perspective(800px) rotateY(-90deg); opacity: 0; }
    100% { transform: perspective(800px) rotateY(0deg); opacity: 1; }
}

@keyframes typingCursor {
    0%, 100% { border-right-color: transparent; }
    50% { border-right-color: var(--text); }
}

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

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

@keyframes speechBubblePop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes stripedProgress {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

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

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(5deg); }
    50% { transform: translate(-5px, -25px) rotate(-3deg); }
    75% { transform: translate(-15px, -10px) rotate(2deg); }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    animation: wiggle 0.4s ease;
}

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

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

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); color: white; }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dark); color: white; }

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

.btn-danger { background: var(--danger); color: white; }

.btn-lg {
    padding: 16px 36px;
    font-size: 1.15rem;
    border-radius: var(--radius);
}

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

.btn-block { display: flex; width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; animation: none; }

/* Button ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s;
    pointer-events: none;
}
.btn:active::after {
    transform: scale(2);
    transition: transform 0s;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: bounceIn 0.5s ease both;
    will-change: transform, opacity;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }
.card:nth-child(6) { animation-delay: 0.4s; }
.card:nth-child(7) { animation-delay: 0.48s; }
.card:nth-child(8) { animation-delay: 0.56s; }

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

.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-4px); }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-control { appearance: none; cursor: pointer; }

.form-error { color: var(--danger); font-size: 0.875rem; margin-top: 4px; }

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
}

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

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i { font-size: 1.3em; }

/* Mascot in navbar */
.navbar-mascot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    position: relative;
    cursor: default;
}

.navbar-mascot .mascot-icon {
    font-size: 1.4rem;
    color: var(--accent);
    animation: mascotBounce 2s ease-in-out infinite;
    will-change: transform;
}

.navbar-mascot .mascot-bubble {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--accent);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.navbar-mascot .mascot-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--accent);
}

.navbar-mascot:hover .mascot-bubble {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a, .navbar-nav button {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.navbar-nav a:hover, .navbar-nav button:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
}

/* ===== Main Content ===== */
.main-content {
    padding-top: calc(var(--nav-height) + 20px);
    min-height: 100vh;
}

/* ===== Page transitions ===== */
.main-content > * {
    animation: slideInUp 0.4s ease both;
}

/* ===== Landing Page ===== */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #E3F2FD 50%, #FFF3E0 100%);
    margin: -20px -20px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(5%, 5%); }
}

/* Floating shapes in hero */
.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-shape {
    position: absolute;
    opacity: 0.15;
    will-change: transform;
}

.hero-shape:nth-child(1) {
    top: 10%;
    left: 5%;
    font-size: 3rem;
    color: #FF6B6B;
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-shape:nth-child(2) {
    top: 20%;
    right: 10%;
    font-size: 2.5rem;
    color: #4ECDC4;
    animation: heroFloat 10s ease-in-out infinite 1s;
}

.hero-shape:nth-child(3) {
    bottom: 20%;
    left: 15%;
    font-size: 2rem;
    color: #45B7D1;
    animation: heroFloat 7s ease-in-out infinite 2s;
}

.hero-shape:nth-child(4) {
    bottom: 15%;
    right: 8%;
    font-size: 3.5rem;
    color: #FFC107;
    animation: heroFloat 9s ease-in-out infinite 0.5s;
}

.hero-shape:nth-child(5) {
    top: 50%;
    left: 8%;
    font-size: 2rem;
    color: #9C27B0;
    animation: heroFloat 11s ease-in-out infinite 1.5s;
}

.hero-shape:nth-child(6) {
    top: 60%;
    right: 15%;
    font-size: 2.5rem;
    color: #FF9800;
    animation: heroFloat 8s ease-in-out infinite 3s;
}

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

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.2;
}

/* Rainbow gradient text for hero heading */
.hero h1 .rainbow-text {
    background: linear-gradient(90deg, #FF6B6B, #FF9800, #FFC107, #4CAF50, #2196F3, #9C27B0, #FF6B6B);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowGradient 4s linear infinite;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 32px;
}

.hero .trial-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Hero mascot */
.hero-mascot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
}

.hero-mascot .mascot-large {
    font-size: 4rem;
    color: var(--accent);
    animation: mascotBounce 2s ease-in-out infinite;
}

.hero-mascot .mascot-speech {
    background: white;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    position: relative;
    animation: speechBubblePop 0.5s ease 0.3s both;
    max-width: 300px;
}

.hero-mascot .mascot-speech::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid white;
}

/* Animated stats counter */
.stats-counter {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 40px 0;
}

.stat-counter-item {
    text-align: center;
    animation: bounceIn 0.6s ease both;
}

.stat-counter-item:nth-child(1) { animation-delay: 0.1s; }
.stat-counter-item:nth-child(2) { animation-delay: 0.2s; }
.stat-counter-item:nth-child(3) { animation-delay: 0.3s; }

.stat-counter-item .counter-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.stat-counter-item .counter-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Preview section */
.preview-section {
    padding: 60px 0;
    background: white;
}

.preview-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.preview-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    border: 2px solid var(--border);
    animation: cardFlip 0.6s ease both;
    will-change: transform;
}

.preview-card:nth-child(1) { animation-delay: 0.1s; }
.preview-card:nth-child(2) { animation-delay: 0.2s; }
.preview-card:nth-child(3) { animation-delay: 0.3s; }

.preview-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.preview-card h4 { margin-bottom: 8px; }
.preview-card p { font-size: 0.9rem; color: var(--text-muted); }

/* Testimonials */
.testimonials {
    padding: 60px 0;
    background: var(--bg-alt);
}

.testimonials h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.testimonial-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    font-size: 4rem;
    color: var(--primary-light);
    position: absolute;
    top: 8px;
    left: 16px;
    line-height: 1;
    font-family: Georgia, serif;
}

.testimonial-card .testimonial-text {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 16px;
    padding-top: 20px;
}

.testimonial-card .testimonial-author {
    font-weight: 700;
    color: var(--text);
}

.testimonial-card .testimonial-role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Features Grid */
.features {
    padding: 80px 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 48px;
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feature-card .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: white;
    transition: transform 0.3s;
}

.feature-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Pricing */
.pricing {
    padding: 80px 0;
    background: var(--bg-alt);
}

.pricing h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 48px;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.pricing-card {
    text-align: center;
    padding: 40px 32px;
    position: relative;
    transition: transform 0.3s ease;
}

.pricing-card.featured {
    border: 3px solid var(--primary);
    transform: scale(1.05);
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    z-index: -1;
    opacity: 0.1;
}

.pricing-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), #FF6B6B);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    animation: pulseGlow 2s ease-in-out infinite;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    margin: 16px 0;
}

.pricing-card .price span { font-size: 1rem; color: var(--text-muted); }

.pricing-card .features-list {
    list-style: none;
    text-align: left;
    margin: 24px 0;
}

.pricing-card .features-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.pricing-card .features-list li i { color: var(--success); }

/* ===== Trial Banner ===== */
.trial-banner {
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.trial-banner .btn {
    padding: 4px 16px;
    font-size: 0.85rem;
    background: white;
    color: var(--accent-dark);
}

.has-trial-banner .main-content {
    padding-top: calc(var(--nav-height) + 56px);
}

/* ===== Auth Pages ===== */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 1.8rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

/* ===== Child Selector ===== */
.child-selector {
    text-align: center;
    padding: 40px 20px;
}

.child-selector h2 { margin-bottom: 32px; }

.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.child-card {
    text-align: center;
    padding: 32px 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.child-card:hover { transform: translateY(-8px); }

.child-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 2rem;
    color: white;
    transition: transform 0.3s, box-shadow 0.3s;
}

.child-card:hover .avatar {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    animation: pulseGlow 1.5s ease-in-out infinite;
}

.child-card .name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.child-card .groep {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.child-card .stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.add-child-card {
    border: 3px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    background: transparent;
    box-shadow: none;
}

.add-child-card i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: transform 0.3s;
}

.add-child-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.add-child-card:hover i {
    transform: rotate(90deg) scale(1.2);
}

/* ===== Subject & Topic Selection ===== */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.subject-card {
    text-align: center;
    padding: 40px 24px;
    cursor: pointer;
    border-left: 5px solid var(--card-color, var(--primary));
    transition: all 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.subject-card i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    transition: transform 0.3s;
}

.subject-card:hover i {
    animation: float 1s ease-in-out infinite;
}

.subject-card h3 { font-size: 1.5rem; }

/* Floating action buttons for topics */
.topic-item {
    transition: all 0.3s ease;
    animation: slideInLeft 0.4s ease both;
    will-change: transform, opacity;
}

.topic-item:nth-child(1) { animation-delay: 0s; }
.topic-item:nth-child(2) { animation-delay: 0.06s; }
.topic-item:nth-child(3) { animation-delay: 0.12s; }
.topic-item:nth-child(4) { animation-delay: 0.18s; }
.topic-item:nth-child(5) { animation-delay: 0.24s; }
.topic-item:nth-child(6) { animation-delay: 0.3s; }
.topic-item:nth-child(7) { animation-delay: 0.36s; }
.topic-item:nth-child(8) { animation-delay: 0.42s; }

.topics-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    cursor: pointer;
}

.topic-item:hover {
    transform: translateX(8px);
}

.topic-item .topic-info { flex: 1; }
.topic-item .topic-name { font-weight: 700; font-size: 1.05rem; }

.topic-item .topic-level {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.skill-bar {
    width: 120px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.topic-item .topic-action { margin-left: 16px; }

.topic-item .topic-action .btn {
    animation: popIn 0.4s ease both;
}

/* ===== Exercise Interface ===== */
.exercise-view {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.exercise-progress {
    flex: 1;
    margin: 0 20px;
}

/* Animated candy cane progress bar */
.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(
        45deg,
        var(--primary) 25%,
        rgba(255,255,255,0.3) 25%,
        rgba(255,255,255,0.3) 50%,
        var(--primary) 50%,
        var(--primary) 75%,
        rgba(255,255,255,0.3) 75%
    );
    background-size: 40px 40px;
    border-radius: 6px;
    transition: width 0.5s ease;
    animation: stripedProgress 1s linear infinite;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Timer animation */
.exercise-timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 60px;
    text-align: right;
    transition: color 0.3s;
}

.exercise-timer.timer-warning {
    color: var(--warning);
    animation: pulseGlow 1s ease-in-out infinite;
}

.exercise-timer.timer-danger {
    color: var(--danger);
    animation: pulseGlow 0.5s ease-in-out infinite;
}

/* Exercise card with flip animation */
.exercise-card {
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 24px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: cardFlip 0.5s ease both;
    will-change: transform;
}

.exercise-card .question {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 32px;
    line-height: 1.4;
}

.theme-kleuters .exercise-card .question { font-size: 1.8rem; }

/* Answer Options */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.theme-kleuters .options-grid {
    grid-template-columns: 1fr;
    gap: 16px;
}

.option-btn {
    padding: 16px 20px;
    border: 3px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--text);
    animation: fadeInScale 0.3s ease both;
    will-change: transform;
}

.option-btn:nth-child(1) { animation-delay: 0.05s; }
.option-btn:nth-child(2) { animation-delay: 0.1s; }
.option-btn:nth-child(3) { animation-delay: 0.15s; }
.option-btn:nth-child(4) { animation-delay: 0.2s; }

.theme-kleuters .option-btn {
    padding: 20px 24px;
    font-size: 1.3rem;
}

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

.option-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    animation: pulseGlow 2s ease-in-out infinite;
}

.option-btn.correct {
    border-color: var(--success);
    background: #E8F5E9;
    color: var(--success);
    animation: correctPulse 0.5s ease;
    position: relative;
}

/* Sparkle effect around correct answers */
.option-btn.correct::before,
.option-btn.correct::after {
    content: '\2726';
    position: absolute;
    font-size: 1.2rem;
    color: var(--warning);
    animation: sparkle 1s ease-in-out infinite;
}

.option-btn.correct::before {
    top: -8px;
    right: -8px;
    animation-delay: 0s;
}

.option-btn.correct::after {
    bottom: -8px;
    left: -8px;
    animation-delay: 0.5s;
}

.option-btn.wrong {
    border-color: var(--danger);
    background: #FFEBEE;
    color: var(--danger);
    animation: shake 0.6s ease;
}

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

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

/* Shake for wrong answer area */
.answer-shake {
    animation: shake 0.6s ease !important;
}

/* Fill-in answer */
.fill-in-group {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

.fill-in-group .form-control {
    font-size: 1.2rem;
    text-align: center;
    font-weight: 700;
}

.theme-kleuters .fill-in-group .form-control { font-size: 1.5rem; }

/* True/False */
.tf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.tf-btn {
    padding: 20px;
    border: 3px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.tf-btn:hover { border-color: var(--primary); transform: scale(1.03); }
.tf-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.tf-btn.correct {
    border-color: var(--success);
    background: #E8F5E9;
    position: relative;
}
.tf-btn.correct::before,
.tf-btn.correct::after {
    content: '\2726';
    position: absolute;
    font-size: 1rem;
    color: var(--warning);
    animation: sparkle 1s ease-in-out infinite;
}
.tf-btn.correct::before { top: -6px; right: -6px; }
.tf-btn.correct::after { bottom: -6px; left: -6px; animation-delay: 0.5s; }
.tf-btn.wrong {
    border-color: var(--danger);
    background: #FFEBEE;
    animation: shake 0.6s ease;
}

/* Feedback */
.feedback-box {
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    width: 100%;
    max-width: 500px;
    animation: fadeSlideIn 0.3s ease;
}

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

.feedback-correct {
    background: #E8F5E9;
    border: 2px solid var(--success);
    color: #2E7D32;
}

.feedback-wrong {
    background: #FFF3E0;
    border: 2px solid var(--warning);
    color: #E65100;
}

.feedback-box .feedback-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-box .feedback-text { font-size: 0.95rem; }

/* Typing effect for AI feedback */
.typing-effect {
    border-right: 2px solid var(--text);
    animation: typingCursor 0.7s step-end infinite;
    display: inline;
}

.xp-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius);
    font-size: 1.5rem;
    font-weight: 800;
    z-index: 2000;
    animation: xpFly 1.5s ease forwards;
    pointer-events: none;
}

@keyframes xpFly {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    50% { transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(0.8); }
}

/* ===== Confetti ===== */
.confetti-piece {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    z-index: 3000;
    pointer-events: none;
    animation: confettiFall 3s ease-out forwards;
    will-change: transform;
}

.confetti-piece:nth-child(odd) {
    border-radius: 50%;
}

.confetti-piece:nth-child(3n) {
    width: 8px;
    height: 14px;
}

/* ===== Star Rain ===== */
.star-rain-piece {
    position: fixed;
    top: -20px;
    font-size: 1.5rem;
    z-index: 3000;
    pointer-events: none;
    animation: starRain 3s ease-out forwards;
    will-change: transform;
    color: var(--warning);
}

/* ===== Mascot Speech Bubble ===== */
.mascot-encouragement {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 1500;
    pointer-events: none;
    animation: slideInUp 0.4s ease both;
}

.mascot-encouragement .mascot-char {
    font-size: 2.5rem;
    color: var(--accent);
    animation: mascotBounce 1s ease-in-out infinite;
}

.mascot-encouragement .mascot-msg {
    background: white;
    padding: 10px 16px;
    border-radius: 12px 12px 0 12px;
    box-shadow: var(--shadow-lg);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    max-width: 200px;
    animation: speechBubblePop 0.4s ease both;
}

/* ===== Session Complete ===== */
.session-complete {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
    animation: bounceIn 0.6s ease both;
}

.session-complete h2 { font-size: 2rem; margin-bottom: 24px; }

.stars-display {
    font-size: 3rem;
    margin: 16px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.stars-display i { color: var(--border); transition: all 0.3s; }
.stars-display i.earned { color: var(--warning); animation: starPop 0.5s ease; }

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Star burst effect */
.star-burst {
    position: relative;
    display: inline-block;
}

.star-burst::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(255,193,7,0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: starBurstGlow 1s ease-out;
    pointer-events: none;
}

@keyframes starBurstGlow {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

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

.stat-box {
    background: var(--bg-alt);
    padding: 16px;
    border-radius: var(--radius-sm);
    animation: bounceIn 0.5s ease both;
}

.stat-box:nth-child(1) { animation-delay: 0.1s; }
.stat-box:nth-child(2) { animation-delay: 0.2s; }
.stat-box:nth-child(3) { animation-delay: 0.3s; }

.stat-box .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Animated XP counter */
.xp-count-up {
    animation: countUp 0.5s ease both;
}

.new-achievement {
    background: linear-gradient(135deg, #FFF8E1, #FFF3E0);
    border: 2px solid var(--accent);
    padding: 20px;
    border-radius: var(--radius);
    margin: 16px 0;
    animation: achievementGlow 2s ease infinite, bounceIn 0.6s ease both;
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255,152,0,0.2); }
    50% { box-shadow: 0 0 20px rgba(255,152,0,0.4); }
}

.new-achievement i { font-size: 2rem; color: var(--accent); margin-bottom: 8px; }

/* ===== Rewards Page ===== */
.rewards-header {
    text-align: center;
    padding: 32px 0;
}

.rewards-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.reward-stat {
    text-align: center;
    padding: 16px 24px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    min-width: 120px;
    transition: transform 0.3s;
}

.reward-stat:hover {
    transform: translateY(-5px);
}

.reward-stat .value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}

.reward-stat .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px 0;
}

.badge-card {
    text-align: center;
    padding: 24px 16px;
    position: relative;
    transition: transform 0.3s;
}

.badge-card:hover {
    transform: translateY(-5px);
}

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

.badge-card .badge-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.5rem;
    background: var(--primary-light);
    color: var(--primary);
    transition: transform 0.3s;
}

.badge-card:not(.locked):hover .badge-icon {
    transform: scale(1.15) rotate(10deg);
}

.badge-card.locked .badge-icon { background: var(--border); color: var(--text-muted); }

.badge-card .badge-name { font-weight: 700; margin-bottom: 4px; }
.badge-card .badge-desc { font-size: 0.85rem; color: var(--text-muted); }

.badge-card .badge-earned {
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 8px;
    font-weight: 600;
}

/* ===== Parent Dashboard ===== */
.dashboard-grid {
    display: grid;
    gap: 24px;
}

.dashboard-child {
    padding: 24px;
}

.dashboard-child-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-child-header .avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.dashboard-child-header .info h3 { margin-bottom: 2px; }
.dashboard-child-header .info .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dashboard-child-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.mini-stat {
    background: var(--bg-alt);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: transform 0.2s;
}

.mini-stat:hover { transform: translateY(-3px); }

.mini-stat .label { font-size: 0.8rem; color: var(--text-muted); }
.mini-stat .value { font-size: 1.3rem; font-weight: 800; color: var(--primary); }

/* ===== Settings ===== */
.settings-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 20px;
}
.settings-page > h2 {
    font-size: 1.6rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.settings-page > h2::before {
    content: '\f013';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary);
}

.settings-section {
    margin-bottom: 0;
    padding: 28px;
    border-radius: var(--radius);
}
.settings-section + .settings-section {
    margin-top: 20px;
}

.settings-section h3 {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary-light);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-section h3 i {
    color: var(--primary);
    width: 24px;
    text-align: center;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }

.settings-tab {
    flex: 1;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.25s ease;
    border-radius: calc(var(--radius) - 4px);
    white-space: nowrap;
    min-width: 0;
}

.settings-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.6);
}

.settings-tab.active {
    color: var(--primary);
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.settings-tab i {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle-label {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle-label i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

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

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

/* Password strength indicator */
.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 4px;
}

.password-strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s, background 0.3s;
}

.password-strength-fill.weak { width: 33%; background: var(--danger); }
.password-strength-fill.medium { width: 66%; background: var(--warning); }
.password-strength-fill.strong { width: 100%; background: var(--success); }

.password-strength-text {
    font-size: 0.8rem;
    font-weight: 600;
}

.password-strength-text.weak { color: var(--danger); }
.password-strength-text.medium { color: var(--warning); }
.password-strength-text.strong { color: var(--success); }

/* Danger Zone */
.danger-zone {
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 24px;
    background: #FFF5F5;
}

.danger-zone h3 {
    color: var(--danger);
    border-bottom-color: var(--danger);
}

.danger-zone .warning-text {
    color: var(--danger);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(244, 67, 54, 0.08);
    border-radius: var(--radius-sm);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #D32F2F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* ===== Child Edit Page ===== */
.child-edit-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.child-edit-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.child-edit-header .avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

/* Avatar picker (expanded) */
.avatar-picker-large {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.avatar-picker-large .avatar-option {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.4rem;
    transition: all 0.2s;
    border: 3px solid transparent;
}

.avatar-picker-large .avatar-option:hover {
    transform: scale(1.15);
}

.avatar-picker-large .avatar-option.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: scale(1.15);
}

/* ===== Learning Goals Sliders ===== */
.goals-section {
    margin-top: 24px;
}

.goal-item {
    margin-bottom: 24px;
}

.goal-item label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.goal-slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.goal-slider-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary-light), var(--primary));
    outline: none;
    transition: all 0.2s;
}

.goal-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.goal-slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.goal-slider-row input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.goal-value {
    min-width: 60px;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

/* Goal radio options */
.goal-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.goal-option {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: center;
    flex: 1;
    min-width: 100px;
}

.goal-option:hover {
    border-color: var(--primary-light);
    background: var(--bg-alt);
}

.goal-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.goal-option i {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

/* ===== Enhanced Progress Page ===== */
.progress-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

/* CSS-only daily activity chart */
.daily-chart {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.daily-chart h3 {
    margin-bottom: 16px;
    font-size: 1rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding-top: 8px;
}

.chart-bar {
    flex: 1;
    min-width: 0;
    background: var(--primary-light);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}

.chart-bar:hover {
    background: var(--primary);
    opacity: 0.9;
}

.chart-bar .chart-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 4px;
    z-index: 10;
}

.chart-bar:hover .chart-tooltip {
    display: block;
}

.chart-bar-active {
    background: var(--primary);
}

.chart-labels {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.chart-label {
    flex: 1;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    min-width: 0;
    overflow: hidden;
}

/* XP progress bar */
.xp-level-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.xp-bar-track {
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #FF6B6B);
    border-radius: 10px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 30px;
}

.xp-level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xp-level-info .level-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
}

/* Topic strength indicators */
.topic-strength-list {
    list-style: none;
    padding: 0;
}

.topic-strength-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.topic-strength-item:last-child {
    border-bottom: none;
}

.topic-strength-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.topic-strength-icon.strong { background: var(--success); }
.topic-strength-icon.weak { background: var(--danger); }

.topic-strength-info {
    flex: 1;
    min-width: 0;
}

.topic-strength-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-strength-level {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-practice-more {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-practice-more:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Quiz history card in progress */
.quiz-history-progress {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.quiz-grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.quiz-grade-badge.excellent { background: #E8F5E9; color: #2E7D32; }
.quiz-grade-badge.good { background: #E3F2FD; color: #1565C0; }
.quiz-grade-badge.sufficient { background: #FFF8E1; color: #F57F17; }
.quiz-grade-badge.insufficient { background: #FFEBEE; color: #C62828; }

/* Subscription card */
.subscription-card {
    background: linear-gradient(135deg, var(--primary-light), var(--bg-card));
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.subscription-status.active { background: #E8F5E9; color: #2E7D32; }
.subscription-status.trial { background: #FFF8E1; color: #F57F17; }
.subscription-status.expired { background: #FFEBEE; color: #C62828; }

/* Loading state for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== Loading / Empty States ===== */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; }

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.3s ease;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid var(--success); }
.toast-error { background: #FFEBEE; color: #C62828; border-left: 4px solid var(--danger); }
.toast-info { background: #E3F2FD; color: #1565C0; border-left: 4px solid var(--secondary); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

.modal h2 { margin-bottom: 24px; }

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Avatar picker */
.avatar-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.avatar-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.avatar-option:hover { transform: scale(1.1); }
.avatar-option.selected {
    border-color: var(--text);
    transform: scale(1.15);
    animation: pulseGlow 1.5s ease-in-out infinite;
}

/* ===== Footer ===== */
.footer {
    background: var(--text);
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer h4 { margin-bottom: 12px; font-size: 1rem; }
.footer p, .footer a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer a:hover { color: white; }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* ===== Text-to-Speech Buttons ===== */
.speak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    vertical-align: middle;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.speak-btn:hover {
    color: var(--primary-dark);
    background: var(--primary-light);
    transform: scale(1.15);
}

.speak-btn:active {
    transform: scale(0.95);
}

/* Speaking animation - pulse */
.speak-btn.speaking {
    animation: speakPulse 1s ease-in-out infinite;
}

@keyframes speakPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

/* Size variants */
.speak-btn-lg {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    margin-left: 8px;
}

.speak-btn-md {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    margin-left: 6px;
}

.speak-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    margin-left: 4px;
}

.speak-btn-xs {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    margin-left: 3px;
}

/* Speak buttons inside option buttons - prevent layout issues */
.option-btn .speak-btn,
.tf-btn .speak-btn {
    position: relative;
    z-index: 2;
}

/* Prevent speak-btn click from triggering parent option selection */
.option-btn .speak-btn:hover,
.tf-btn .speak-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Sound toggle in navbar */
.sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sound-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Theme-specific speak button adjustments */
.theme-kleuters .speak-btn {
    color: var(--accent);
}
.theme-kleuters .speak-btn:hover {
    background: rgba(255,183,77,0.2);
    color: var(--accent-dark);
}
/* Kleuters: bigger speak buttons always visible */
.theme-kleuters .speak-btn-lg {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
    background: rgba(255,183,77,0.1);
    border: 2px solid var(--accent);
}

.theme-onderbouw .speak-btn {
    color: var(--secondary);
}
.theme-onderbouw .speak-btn:hover {
    background: rgba(102,187,106,0.15);
}

/* Question speak button - prominent */
.question .speak-btn {
    margin-left: 10px;
}

/* Feedback speak button */
.feedback-box .speak-btn {
    margin-left: 6px;
}

/* ===== Theme-specific animation adjustments ===== */
/* Kleuters: MORE animations */
.theme-kleuters .card {
    animation-duration: 0.7s;
}
.theme-kleuters .btn:hover {
    animation: wiggle 0.5s ease;
}
.theme-kleuters .exercise-card {
    animation-duration: 0.7s;
}

/* Bovenbouw: LESS animations */
.theme-bovenbouw .card {
    animation: fadeInScale 0.3s ease both;
}
.theme-bovenbouw .btn:hover {
    animation: none;
    transform: translateY(-2px);
}
.theme-bovenbouw body::after {
    animation: none;
}

/* ===== Responsive: iPad / Tablet (768px - 1024px) ===== */
@media (max-width: 1024px) {
    .container { max-width: 100%; padding: 0 24px; }
    .hero { padding: 60px 24px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .pricing-cards { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .pricing-card.featured { transform: scale(1.02); }
    .children-grid { grid-template-columns: repeat(3, 1fr); }
    .topics-list { max-width: 100%; }
    .exercise-card { max-width: 100%; }
    .session-complete { max-width: 100%; padding: 24px; }
    .settings-page { max-width: 100%; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ===== Responsive: Mobile Landscape & Small Tablets (481px - 768px) ===== */
@media (max-width: 768px) {
    :root { --nav-height: 56px; }

    /* Navbar */
    .navbar-nav { display: none; }
    .navbar-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: white;
        padding: 16px;
        box-shadow: var(--shadow);
        z-index: 1000;
        gap: 8px;
    }
    .navbar-nav.open a,
    .navbar-nav.open button {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
    }
    .navbar-nav.open a:hover,
    .navbar-nav.open button:hover {
        background: var(--bg-alt);
    }
    .navbar-toggle { display: block; }
    .navbar-brand { font-size: 1.1rem; }

    /* Hero */
    .hero { padding: 40px 20px; min-height: auto; }
    .hero h1 { font-size: 1.8rem; line-height: 1.2; }
    .hero p { font-size: 1rem; }
    .hero-shapes .hero-shape { display: none; }

    /* Grids */
    .features-grid { grid-template-columns: 1fr; gap: 16px; }
    .pricing-cards { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .pricing-card.featured { transform: none; }
    .children-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .options-grid { grid-template-columns: 1fr; gap: 12px; }
    .session-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .avatar-picker { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .dashboard-child-stats { grid-template-columns: repeat(2, 1fr); }
    .rewards-stats { gap: 12px; }
    .reward-stat { min-width: 100px; padding: 12px 16px; }

    /* Stats */
    .stats-counter { gap: 20px; flex-wrap: wrap; }
    .stat-counter-item .counter-value { font-size: 2rem; }

    /* Mascot */
    .hero-mascot { flex-direction: column; gap: 16px; }
    .hero-mascot .mascot-speech::before { display: none; }
    .mascot-encouragement { bottom: 10px; right: 10px; max-width: 250px; }

    /* Exercise */
    .exercise-view { padding: 0 8px; }
    .exercise-header { gap: 8px; flex-wrap: wrap; }
    .exercise-card { padding: 20px 16px; }
    .question { font-size: 1.1rem; }
    .option-btn { padding: 14px 16px; font-size: 1rem; min-height: 52px; }
    .tf-btn { padding: 16px; font-size: 1.1rem; min-height: 56px; }
    .fill-in-group input { font-size: 1.2rem; padding: 14px; }

    /* Buttons */
    .btn-lg { padding: 14px 28px; font-size: 1rem; }

    /* Cards */
    .card { padding: 20px 16px; }

    /* Auth forms */
    .auth-form { max-width: 100%; padding: 20px; }

    /* Modal */
    .modal { width: 95%; max-width: 95%; margin: 16px; padding: 20px; }
    .modal-overlay { align-items: flex-start; padding-top: 40px; }
}

/* ===== Responsive: Mobile Portrait (max 480px) ===== */
@media (max-width: 480px) {
    :root { --nav-height: 52px; }

    body { font-size: 15px; }
    .container { padding: 0 16px; }

    /* Hero */
    .hero { padding: 30px 16px; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: 0.9rem; }
    .hero .btn-lg { width: 100%; }

    /* Grids single column */
    .children-grid { grid-template-columns: 1fr; gap: 12px; }
    .badges-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .session-stats { grid-template-columns: 1fr; gap: 10px; }
    .pricing-cards { max-width: 100%; }

    /* Child cards */
    .child-card { padding: 16px; }
    .child-card .avatar { width: 56px; height: 56px; font-size: 1.5rem; }
    .child-card .name { font-size: 1.1rem; }
    .add-child-card { padding: 20px; }

    /* Exercise full width */
    .exercise-view { padding: 0; }
    .exercise-header { padding: 8px 12px; }
    .exercise-card { border-radius: 0; padding: 16px 14px; margin: 0 -16px; }
    .question { font-size: 1.05rem; line-height: 1.5; }
    .option-btn {
        padding: 16px 14px;
        font-size: 1.05rem;
        min-height: 56px;
        border-radius: var(--radius-sm);
        touch-action: manipulation;
    }
    .tf-btn {
        padding: 18px;
        font-size: 1.15rem;
        min-height: 60px;
        touch-action: manipulation;
    }
    .fill-in-group input {
        font-size: 1.3rem;
        padding: 16px;
        border-radius: var(--radius-sm);
    }

    /* Feedback */
    .feedback-box { padding: 14px; font-size: 0.95rem; }

    /* Action buttons full width on mobile */
    #action-area { padding: 0 16px; }
    #action-area .btn { width: 100%; }

    /* Session complete */
    .session-complete { padding: 20px 16px; }
    .session-complete h2 { font-size: 1.4rem; }
    .stars-display { gap: 16px; }
    .stars-display .fa-star { font-size: 2.5rem; }
    .stat-box { padding: 12px; }
    .stat-box .stat-value { font-size: 1.5rem; }
    .new-achievement { padding: 12px; }

    /* Auth */
    .auth-form { padding: 16px; }
    .auth-form h2 { font-size: 1.3rem; }
    .form-control { padding: 12px 14px; font-size: 1rem; }

    /* Settings */
    .settings-page { padding: 16px 0; }
    .settings-section { padding: 16px; }

    /* Buttons */
    .btn { padding: 12px 20px; font-size: 0.95rem; }
    .btn-lg { padding: 14px 24px; font-size: 1rem; width: 100%; justify-content: center; }
    .btn-sm { padding: 8px 14px; font-size: 0.85rem; }

    /* Modal full screen on mobile */
    .modal-overlay { padding: 0; align-items: stretch; }
    .modal {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        margin: 0;
        padding: 24px 20px;
        display: flex;
        flex-direction: column;
    }
    .modal form { flex: 1; display: flex; flex-direction: column; }
    .modal .modal-actions { margin-top: auto; padding-top: 20px; }
    .avatar-picker { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .avatar-option { width: 52px; height: 52px; }

    /* Topics */
    .topic-item { padding: 14px; }
    .topic-name { font-size: 1rem; }
    .topic-action .btn { padding: 8px 14px; font-size: 0.85rem; }

    /* Dashboard */
    .dashboard-child-stats { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* Rewards */
    .rewards-stats { flex-direction: column; align-items: center; }
    .reward-stat { width: 100%; max-width: 200px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; text-align: center; }

    /* Hide decorative elements on mobile */
    .hero-shapes { display: none; }
    .mascot-encouragement { display: none; }

    /* Landing page stats */
    .stats-counter { flex-direction: column; gap: 16px; }
    .stat-counter-item { min-width: auto; }
}

/* ===== Touch device optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .option-btn { min-height: 52px; }
    .tf-btn { min-height: 56px; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .navbar-nav a, .navbar-nav button { min-height: 44px; display: flex; align-items: center; }

    /* Remove hover effects that don't work on touch */
    .card:hover { box-shadow: var(--shadow); }
    .card-clickable:hover { transform: none; }
    .btn:hover { transform: none; }

    /* Active states for touch feedback */
    .option-btn:active { transform: scale(0.97); background: var(--primary-light); }
    .tf-btn:active { transform: scale(0.97); }
    .btn:active { transform: scale(0.97); opacity: 0.9; }
    .card-clickable:active { transform: scale(0.98); box-shadow: var(--shadow-lg); }

    /* Prevent double-tap zoom */
    .option-btn, .tf-btn, .btn, .card-clickable, .avatar-option, .speak-btn {
        touch-action: manipulation;
    }

    /* Disable text selection on interactive elements */
    .option-btn, .tf-btn, .btn, .card-clickable, .avatar-option, .navbar {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Speak buttons easier to tap */
    .speak-btn { min-width: 36px; min-height: 36px; }
}

/* ===== iPad Pro / Large Tablet Landscape ===== */
@media (min-width: 1025px) and (max-width: 1366px) {
    .container { max-width: 1000px; }
    .features-grid { grid-template-columns: repeat(3, 1fr); }
    .pricing-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Safe area insets for notched devices (iPhone X+) ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .navbar {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    #action-area {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    .modal {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* ===== PWA standalone mode ===== */
@media (display-mode: standalone) {
    .navbar {
        padding-top: env(safe-area-inset-top, 0);
    }
    body {
        padding-top: 0;
    }
}

/* ===== Language Picker ===== */
.language-picker {
    position: relative;
    display: inline-block;
}

.language-picker-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: inherit;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.language-picker-btn:hover {
    background: rgba(255,255,255,0.1);
}

.language-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    min-width: 180px;
    padding: 4px 0;
}

.language-picker-dropdown.open {
    display: block;
}

.language-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text, #333);
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.language-option:hover {
    background: var(--primary-light, #e8f5e9);
}

.language-option.active {
    font-weight: 700;
    color: var(--primary, #4CAF50);
}

/* ===== RTL Support ===== */
html[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

html[dir="rtl"] .hero-content,
html[dir="rtl"] .text-center {
    direction: rtl;
}

html[dir="rtl"] .features-grid,
html[dir="rtl"] .dashboard-grid,
html[dir="rtl"] .children-grid,
html[dir="rtl"] .topics-list,
html[dir="rtl"] .badges-grid {
    direction: rtl;
}

html[dir="rtl"] .btn i:first-child {
    margin-right: 0;
    margin-left: 6px;
}

html[dir="rtl"] .exercise-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .progress-bar-fill {
    transform-origin: right;
}

html[dir="rtl"] .skill-bar-fill {
    transform-origin: right;
}

html[dir="rtl"] .language-picker-dropdown {
    right: auto;
    left: 0;
}

html[dir="rtl"] .language-option {
    text-align: right;
}

html[dir="rtl"] .modal-actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .form-group label {
    text-align: right;
}

html[dir="rtl"] .auth-footer {
    direction: rtl;
}

html[dir="rtl"] .footer-grid {
    direction: rtl;
}

html[dir="rtl"] .fa-arrow-left::before {
    content: "\f061";
}

html[dir="rtl"] .fa-arrow-right::before {
    content: "\f060";
}

/* CJK Font Support */
html[lang="ja"] body,
html[lang="zh"] body,
html[lang="ko"] body {
    font-family: 'Nunito', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
}

html[lang="ar"] body,
html[lang="he"] body,
html[lang="fa"] body,
html[lang="ur"] body {
    font-family: 'Nunito', 'Noto Sans Arabic', 'Noto Sans Hebrew', system-ui, -apple-system, sans-serif;
}

html[lang="hi"] body,
html[lang="bn"] body {
    font-family: 'Nunito', 'Noto Sans Devanagari', 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
}

html[lang="th"] body {
    font-family: 'Nunito', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
}

/* ===== Quiz System ===== */

/* Quiz badge on topics */
.quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FF5722, #FF9800);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 8px;
    animation: pulseGlow 2s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.training-count-badge {
    display: inline-block;
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.topic-item.quiz-due {
    border-left: 4px solid #FF5722;
    background: linear-gradient(to right, rgba(255, 87, 34, 0.04), transparent);
}

.topic-item.quiz-due:hover {
    border-left-color: #FF9800;
}

/* Quiz button style */
.btn-quiz {
    background: linear-gradient(135deg, #FF5722, #FF9800);
    color: white;
}
.btn-quiz:hover {
    background: linear-gradient(135deg, #E64A19, #F57C00);
    color: white;
}

/* Quiz modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInScale 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.5s ease;
}

.quiz-modal-content .quiz-modal-icon {
    font-size: 3rem;
    color: #FF5722;
    margin-bottom: 16px;
}

.quiz-modal-content h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 12px;
}

.quiz-modal-content p {
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

.quiz-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-modal-actions .btn {
    justify-content: center;
}

/* Quiz mode exercise view */
.exercise-view.quiz-mode .exercise-header {
    border-bottom: 3px solid #FF5722;
    padding-bottom: 12px;
}

.quiz-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #FF5722;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.progress-bar-quiz {
    background: #FFE0B2;
}

.progress-bar-fill-quiz {
    background: linear-gradient(
        45deg,
        #FF5722 25%,
        rgba(255,255,255,0.3) 25%,
        rgba(255,255,255,0.3) 50%,
        #FF5722 50%,
        #FF5722 75%,
        rgba(255,255,255,0.3) 75%
    ) !important;
    background-size: 40px 40px;
}

.exercise-card-quiz {
    border: 2px solid #FF5722;
    border-top: 4px solid #FF5722;
}

.quiz-no-hints-notice {
    background: #FFF3E0;
    color: #E65100;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    width: 100%;
}

.quiz-timer {
    font-size: 1.3rem;
    color: #FF5722;
    font-weight: 800;
    background: #FFF3E0;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.feedback-quiz-wrong {
    border-left: 4px solid #F44336;
}

/* Quiz complete screen */
.quiz-complete h2 {
    color: #FF5722;
}

.quiz-grade-display {
    margin: 24px 0;
    text-align: center;
}

.quiz-grade-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--grade-color, #999);
    color: white;
    font-size: 3rem;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: bounceIn 0.6s ease both;
}

.quiz-grade-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--grade-color, #999);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quiz-score-bar-wrap {
    max-width: 400px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-score-bar {
    flex: 1;
    height: 16px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.quiz-score-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 1s ease;
}

.quiz-score-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    min-width: 50px;
}

/* Question breakdown */
.quiz-breakdown {
    max-width: 500px;
    margin: 16px auto;
    text-align: left;
}

.quiz-breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.9rem;
    animation: slideInLeft 0.3s ease both;
}

.quiz-breakdown-item:nth-child(1) { animation-delay: 0.05s; }
.quiz-breakdown-item:nth-child(2) { animation-delay: 0.1s; }
.quiz-breakdown-item:nth-child(3) { animation-delay: 0.15s; }
.quiz-breakdown-item:nth-child(4) { animation-delay: 0.2s; }
.quiz-breakdown-item:nth-child(5) { animation-delay: 0.25s; }

.breakdown-correct {
    background: #E8F5E9;
}

.breakdown-wrong {
    background: #FFEBEE;
}

.breakdown-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.breakdown-question {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breakdown-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.quiz-email-notice {
    background: #E3F2FD;
    color: #1565C0;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin: 16px auto;
    max-width: 500px;
    text-align: center;
}

.quiz-email-notice i {
    margin-right: 8px;
}

/* Quiz history */
.quiz-avg-card {
    background: linear-gradient(135deg, #FF5722, #FF9800);
    color: white;
}

.quiz-avg-value {
    font-size: 3rem;
    font-weight: 900;
}

.quiz-avg-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.quiz-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.quiz-history-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    font-size: 1.4rem;
    font-weight: 900;
    flex-shrink: 0;
}

.quiz-history-info {
    flex: 1;
}

.quiz-history-topic {
    font-weight: 700;
    font-size: 1rem;
}

.quiz-history-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.quiz-history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Settings / Child edit / Progress responsive ===== */
@media (max-width: 600px) {
    .settings-tabs {
        gap: 0;
    }
    .settings-tab {
        padding: 10px 6px;
        font-size: 0.75rem;
    }
    .settings-tab i {
        font-size: 1rem;
    }
    .avatar-picker-large {
        grid-template-columns: repeat(4, 1fr);
    }
    .goal-options {
        flex-direction: column;
    }
    .goal-option {
        min-width: unset;
    }
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-bars {
        height: 80px;
    }
    .child-edit-page,
    .progress-page {
        padding: 12px;
    }
}

/* ===== Visual Exercise Elements ===== */
.visual-display {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 20px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.visual-icons i {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    transition: transform 0.2s;
}
.visual-icons i:hover {
    transform: scale(1.2);
}

.visual-letter {
    font-family: var(--font);
    font-weight: 900;
    color: var(--primary);
    text-shadow: 3px 3px 0 var(--primary-light);
}

.color-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 8px;
    border: 4px solid transparent;
    transition: transform 0.3s, border-color 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.color-circle.highlighted {
    border-color: var(--text);
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.visual-number-line {
    display: flex;
    gap: 0;
    align-items: center;
}
.nl-num {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--border);
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}
.nl-num.highlighted {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.visual-shape {
    width: 70px;
    height: 70px;
    margin: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 8px; }
.shape-triangle {
    width: 0;
    height: 0;
    background: transparent !important;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid var(--primary);
    box-shadow: none;
}

.visual-comparison {
    gap: 20px;
}
.comparison-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 200px;
}
.comparison-vs {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-muted);
}

/* Responsive visuals */
@media (max-width: 480px) {
    .visual-display { padding: 16px 12px; }
    .visual-icons i { font-size: 2rem !important; margin: 6px !important; }
    .color-circle { width: 60px; height: 60px; }
    .nl-num { width: 36px; height: 36px; font-size: 1.1rem; }
    .visual-shape { width: 50px; height: 50px; }
    .comparison-group { max-width: 140px; }
    .comparison-vs { font-size: 2rem; }
}

/* ===== PWA Install Banner ===== */
.install-banner {
    position: fixed;
    bottom: -120px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    transition: bottom 0.3s ease;
    padding: 16px 20px;
    border-top: 3px solid var(--primary);
}
.install-banner.show { bottom: 0; }
.install-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}
.install-banner-icon {
    font-size: 2rem;
    color: var(--primary);
    flex-shrink: 0;
}
.install-banner-text { flex: 1; }
.install-banner-text p { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-light); }
.install-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

.install-banner-ios {
    border-top-color: var(--secondary);
}
.ios-arrow {
    text-align: center;
    font-size: 2rem;
    color: var(--secondary);
    margin-top: 4px;
    animation: bounceDown 1s infinite;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Safe area for install banner */
@supports (padding: env(safe-area-inset-bottom)) {
    .install-banner { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
    .install-banner-content { flex-wrap: wrap; }
    .install-banner-actions { width: 100%; justify-content: stretch; }
    .install-banner-actions .btn { flex: 1; }
}

/* ===== Reduced motion preference ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
