:root {
    --primary-color: #6C5CE7;
    --primary-light: #A29BFE;
    --secondary-color: #00CEC9;
    --secondary-light: #81ECEC;
    --accent-color: #FD79A8;
    --accent-light: #FAB1A0;
    --success-color: #00b894;
    --danger-color: #d63031;
    --background-color: #1A1A2E; /* Magical Night */
    --card-bg: #FFFFFF;
    --text-main: #E8E4D9; /* Light text for dark body */
    --text-muted: #A0A0A0;
    --shadow-soft: 0 10px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 15px 30px rgba(108, 92, 231, 0.15);
    --border-radius: 20px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(108, 92, 231, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(253, 121, 168, 0.15), transparent 25%),
        radial-gradient(circle at 50% 80%, rgba(0, 206, 201, 0.1), transparent 20%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header & Breadcrumb */
.app-header {
    background: linear-gradient(135deg, #E8E4D9, #DCD0FF);
    color: #2D1500;
    padding: 2rem 5%;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    box-shadow: 0 10px 30px rgba(220, 208, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.user-profile {
    font-size: 1.8rem;
    background: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-name {
    font-weight: 800;
    color: #2D1500;
    font-size: 1.1rem;
}

.header-spacer { width: 150px; }

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}
.logo h1 { font-size: 2.2rem; font-weight: 800; color: #2D1500; }

/* Progress branch */
.progress-container {
    margin-top: 1.5rem;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.progress-branch {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 8px;
    background: #8B5A2B;
    border-radius: 4px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}
.butterfly-indicator {
    position: absolute;
    right: 10px; /* Start at right (RTL) */
    font-size: 2rem;
    transition: right 1s ease-in-out;
    filter: drop-shadow(0 0 10px #DCD0FF);
    z-index: 2;
    transform: scaleX(-1); /* Face left */
}
.lantern-end {
    position: absolute;
    left: 10px;
    font-size: 2rem;
    z-index: 2;
    filter: drop-shadow(0 0 15px #FFD700);
}

.breadcrumb { margin-top: 1.5rem; display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; color: #2D1500; font-weight: bold; }
.breadcrumb span { cursor: pointer; background-color: rgba(255, 255, 255, 0.5); padding: 0.3rem 1rem; border-radius: 30px; transition: all var(--transition-speed); color: #2D1500; font-weight: 700; }
.breadcrumb span:hover { background-color: rgba(255, 255, 255, 0.8); transform: translateY(-2px); }
.breadcrumb span.active { background-color: white; color: var(--primary-color); font-weight: 800; pointer-events: none; border: 2px solid var(--primary-color); }

/* Main Container */
.app-container { flex-grow: 1; padding: 3rem 5%; max-width: 1200px; margin: 0 auto; width: 100%; position: relative; z-index: 1; }
.view-title { text-align: center; font-size: 2.8rem; color: #FFD700; margin-bottom: 3rem; font-weight: 800; text-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 5px rgba(255, 215, 0, 0.3); }

/* Grid & Cards */
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 3.5rem 2rem; justify-content: center; }
.games-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
    background: linear-gradient(145deg, #2D1500, #4A2511);
    border-radius: 10px 25px 25px 10px;
    padding: 2rem; text-align: center;
    cursor: pointer; box-shadow: -5px 10px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255,215,0,0.1);
    transition: all var(--transition-speed);
    border: none; border-right: 15px solid #D2B48C; border-left: 8px solid #1A0D00;
    min-height: 200px; display: flex; flex-direction: column; justify-content: center;
    position: relative;
}
.card::after {
    content: ''; position: absolute; bottom: -20px; left: -15px; right: -25px; height: 15px;
    background: linear-gradient(to right, #3E2723, #5D4037); border-radius: 5px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.6); z-index: -1;
}
.card:hover { transform: translateY(-10px) scale(1.02); box-shadow: -5px 15px 30px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(255,215,0,0.3); border-right-color: #FFD700; }
.card h2 { font-size: 1.8rem; margin-bottom: 0.5rem; color: #FFD700; font-weight: 800; text-shadow: 0 0 5px rgba(255,215,0,0.5); }
.card p { color: #E8E4D9; font-weight: 700;}

/* Wavy Lesson Path */
.lesson-path-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding: 2rem 0;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* The Glowing Dotted Line */
.lesson-path-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    border-left: 4px dashed #FFD700;
    transform: translateX(-50%);
    filter: drop-shadow(0 0 8px #FFD700);
    z-index: 0;
}

.wavy-lesson-item {
    position: relative;
    z-index: 1;
    width: 250px;
}

.wavy-lesson-item:nth-child(odd) {
    transform: translateX(120px);
}
.wavy-lesson-item:nth-child(even) {
    transform: translateX(-120px);
}

/* Wooden Lantern Buttons */
.lantern-card {
    background-color: var(--card-bg);
    border-radius: 50%;
    width: 220px;
    height: 220px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), inset 0 0 15px rgba(139, 90, 43, 0.2);
    transition: all 0.4s ease;
    border: 8px solid #D2B48C;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0.1));
}

.lantern-card h2 {
    font-size: 1.5rem;
    color: #2D1500;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.lantern-card p {
    color: #5C4033;
    font-weight: bold;
}

.lantern-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 215, 0, 0.5);
    border-color: #FFD700;
}
.lantern-card:hover h2 {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.headphone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2D1500;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

/* Tabs Logic */
.lesson-tabs { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.tab-btn {
    background-color: var(--card-bg); border: 2px solid var(--primary-light); color: var(--primary-color);
    padding: 0.8rem 1.5rem; border-radius: 30px; font-family: 'Cairo', sans-serif; font-size: 1.1rem;
    font-weight: 700; cursor: pointer; transition: all var(--transition-speed);
}
.tab-btn:hover { background-color: var(--primary-light); color: white; }
.tab-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s ease-out forwards; }
.hidden { display: none !important; }

/* Fun Mascot & Decorations */
.mascot-container { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-bottom: 2rem; position: relative; z-index: 2;}
.mascot-svg { animation: floatMascot 3s ease-in-out infinite; filter: drop-shadow(0 10px 10px rgba(108, 92, 231, 0.2)); }
.clickable-mascot { cursor: pointer; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2)); }
.clickable-mascot:hover { transform: scale(1.1) rotate(5deg); filter: drop-shadow(0 10px 25px var(--accent-color)); }
.mascot-pupil { transition: all 0.3s; }
.clickable-mascot:hover .mascot-pupil { transform: translate(2px, -2px); }

@keyframes flutterWings {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(0.5); }
}
.wing-left, .wing-right { animation: flutterWings 0.15s ease-in-out infinite alternate; }
.mascot-speech { background: white; padding: 1rem 1.5rem; border-radius: 20px; font-weight: bold; color: var(--primary-color); font-size: 1.2rem; position: relative; border: 3px solid var(--primary-light); box-shadow: var(--shadow-soft); animation: popSpeech 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.mascot-speech::before { content: ''; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); border-width: 10px 0 10px 15px; border-style: solid; border-color: transparent transparent transparent var(--primary-light); }
.mascot-speech::after { content: ''; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); border-width: 7px 0 7px 10px; border-style: solid; border-color: transparent transparent transparent white; }

.floating-decorations { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 1;}
.decor-item { position: absolute; font-size: 2.5rem; opacity: 0.6; }
.star-anim { animation: twinkle 2s infinite alternate; }
.cloud-anim { animation: floatCloud 10s linear infinite; font-size: 4rem; opacity: 0.4;}

/* Dialogues & Sentences */
.section-title { font-size: 1.5rem; color: var(--primary-color); margin: 2rem 0 1rem 0; text-align: center; border-bottom: 2px dashed var(--primary-light); padding-bottom: 0.5rem;}
.dialogue-section { margin-bottom: 2rem; }
.dialogue-list { display: flex; flex-direction: column; gap: 1rem; max-width: 800px; margin: 0 auto;}
.dialogue-bubble { 
    background-color: var(--card-bg); border-radius: var(--border-radius); padding: 1.5rem;
    display: flex; align-items: center; gap: 1.5rem; box-shadow: var(--shadow-soft);
    border-left: 5px solid var(--primary-color); transition: transform var(--transition-speed);
}
.dialogue-bubble:hover { transform: translateX(-5px); box-shadow: var(--shadow-hover); }
.speaker-emoji { font-size: 3rem; background: var(--background-color); border-radius: 50%; padding: 0.5rem; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);}
.dialogue-content { flex-grow: 1; }
.english-dialogue { font-family: 'Nunito', sans-serif; font-size: 1.5rem; color: #2D3436; font-weight: 800; margin-bottom: 0.5rem;}
.arabic-dialogue { font-size: 1.2rem; color: var(--primary-color); font-weight: 600; }
.dialogue-controls { flex-direction: column; }

/* Flashcards Grid */
.flashcards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1px)); gap: 1.5rem; justify-content: center; }
.flashcard {
    background-color: var(--card-bg); border-radius: var(--border-radius); padding: 2rem;
    text-align: center; box-shadow: var(--shadow-soft); border: 2px solid var(--secondary-light);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.flashcard-emoji { font-size: 5rem; animation: float 3s ease-in-out infinite; }
.english-word { font-family: 'Nunito', sans-serif; font-size: 1.8rem; color: var(--primary-color); font-weight: 800; direction: ltr; }
.arabic-word { font-size: 1.3rem; color: #636E72; font-weight: 600; padding: 0.5rem; background: #F0F0F0; border-radius: 10px; width: 100%;}
.flashcard-controls { display: flex; gap: 0.5rem; }
.btn-icon { border: none; width: 45px; height: 45px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-play { background-color: var(--secondary-light); color: #000; }
.btn-play:hover { background-color: var(--secondary-color); color: #fff; transform: scale(1.1); }
.btn-translate { background-color: var(--accent-light); color: #000; }
.btn-translate:hover { background-color: var(--accent-color); color: #fff; transform: scale(1.1); }

/* Common Game UI */
.game-header { text-align: center; margin-bottom: 2rem; }
.game-header h3 { font-size: 2rem; color: var(--primary-color); margin-bottom: 0.5rem; }
.game-header p { font-size: 1.2rem; color: var(--text-muted); }
.btn-big-play { background-color: var(--secondary-color); color: white; border: none; padding: 1rem 2rem; border-radius: 30px; font-family: 'Cairo'; font-size: 1.5rem; font-weight: bold; cursor: pointer; margin-top: 1rem; box-shadow: 0 4px 15px rgba(0, 206, 201, 0.4); transition: transform 0.2s; }
.btn-big-play:hover { transform: scale(1.05); }
.feedback-msg { text-align: center; font-size: 1.5rem; font-weight: bold; min-height: 40px; margin-top: 1rem;}
.feedback-msg .correct { color: var(--success-color); animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; display: inline-block; }
.feedback-msg .wrong { color: var(--danger-color); animation: shake 0.5s ease-in-out forwards; display: inline-block; }

/* Game 1: Balloons */
.balloon-container { position: relative; height: 400px; background: linear-gradient(to top, #81ECEC 0%, #FFFFFF 100%); border-radius: var(--border-radius); overflow: hidden; border: 3px solid var(--primary-light); box-shadow: inset 0 0 20px rgba(0,0,0,0.1);}
.balloon { position: absolute; bottom: -100px; width: 80px; height: 100px; background: var(--accent-light); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; cursor: pointer; animation: floatUp linear forwards; display: flex; align-items: center; justify-content: center; box-shadow: inset -5px -5px 15px rgba(0,0,0,0.1); }
.balloon::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 2px; height: 30px; background: var(--text-muted); }
.balloon-emoji { font-size: 3rem; z-index: 2; pointer-events: none; }
.balloon:hover { transform: scale(1.1); }
.balloon.popped { animation: none; background: transparent; box-shadow: none; font-size: 4rem; justify-content: center; align-items: center; }
.balloon.popped::after { display: none; }
.balloon.popped-wrong { animation-play-state: paused; filter: grayscale(100%); opacity: 0.5; }
@keyframes floatUp { to { bottom: 100%; } }

/* Game 2: Memory */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 600px; margin: 0 auto 2rem auto; perspective: 1000px; }
.memory-card { width: 100%; aspect-ratio: 1; cursor: pointer; position: relative; border-radius: var(--border-radius); }
.memory-card-inner { width: 100%; height: 100%; position: absolute; transition: transform 0.6s; transform-style: preserve-3d; border-radius: var(--border-radius); box-shadow: var(--shadow-soft); }
.memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }
.memory-card.matched .memory-card-inner { transform: rotateY(180deg) scale(0.95); opacity: 0.8; box-shadow: 0 0 15px var(--success-color); }
.memory-card-front, .memory-card-back { width: 100%; height: 100%; position: absolute; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; border-radius: var(--border-radius); }
.memory-card-front { background: linear-gradient(135deg, var(--primary-light), var(--primary-color)); font-size: 3rem; color: white; border: 3px solid var(--primary-color); }
.memory-card-back { background-color: white; border: 3px solid var(--primary-light); transform: rotateY(180deg); }
.memory-card-back.emoji-content { font-size: 4rem; }
.memory-card-back.text-content { font-family: 'Nunito', sans-serif; font-size: 1.5rem; font-weight: bold; color: var(--text-main); }

/* Game 3: Speed Run */
.speed-stats { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; }
.score-badge, .timer-badge { background: var(--card-bg); padding: 0.5rem 1.5rem; border-radius: 20px; font-weight: bold; font-size: 1.2rem; box-shadow: var(--shadow-soft); border: 2px solid var(--primary-light); }
.timer-badge { color: var(--danger-color); border-color: var(--accent-light); }
.score-badge { color: var(--success-color); border-color: var(--secondary-light); }
.target-word { font-family: 'Nunito', sans-serif; font-size: 3rem; font-weight: 900; color: var(--accent-color); text-align: center; }
.arabic-target { font-family: 'Cairo', sans-serif; font-size: 2.5rem; color: var(--primary-color); }
.game-options { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.game-option-btn { background-color: var(--card-bg); border: 3px solid var(--primary-light); border-radius: var(--border-radius); cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-soft); display: flex; align-items: center; justify-content: center; }
.game-option-btn:hover { transform: translateY(-5px); border-color: var(--primary-color); }
.text-opt { font-family: 'Nunito', sans-serif; font-size: 1.8rem; font-weight: 800; padding: 1rem 2rem; min-width: 150px; }

/* Game 4: Scramble */
.scramble-slots { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; direction: ltr; }
.letter-slot { width: 60px; height: 60px; border: 3px dashed var(--primary-light); border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-family: 'Nunito', sans-serif; font-weight: 900; color: var(--primary-color); transition: all 0.2s; cursor: pointer; }
.letter-slot.filled { background-color: var(--card-bg); border-style: solid; box-shadow: var(--shadow-soft); }
.scramble-letters { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; direction: ltr; }
.letter-btn { width: 60px; height: 60px; background-color: var(--secondary-light); border: none; border-radius: 15px; font-size: 2rem; font-family: 'Nunito', sans-serif; font-weight: 900; color: var(--text-main); cursor: pointer; transition: transform 0.2s, background-color 0.2s; box-shadow: 0 4px 0 var(--secondary-color); }
.letter-btn:active { transform: translateY(4px); box-shadow: none; }
.letter-btn:empty { visibility: hidden; }

/* Game 5: Flying Bubbles */
.bubbles-container { position: relative; height: 400px; background: linear-gradient(to bottom, #A29BFE 0%, #F8F9FA 100%); border-radius: var(--border-radius); overflow: hidden; border: 3px solid var(--primary-light); }
.flying-bubble { position: absolute; bottom: -150px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.4)); border-radius: 50%; box-shadow: inset 0 0 20px rgba(255,255,255,0.8), 0 10px 20px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; cursor: pointer; animation: floatBubble 6s ease-in infinite alternate, riseUp 8s linear forwards; border: 1px solid rgba(255,255,255,0.6); }
.bubble-text { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.5rem; color: var(--primary-color); pointer-events: none; text-shadow: 1px 1px 0 #fff; }
.flying-bubble.popped { animation: none; background: transparent; box-shadow: none; border: none; font-size: 4rem; justify-content: center; align-items: center; }
.flying-bubble.popped .bubble-text { display: none; }
@keyframes floatBubble { 0% { transform: translateX(0) scale(1); } 100% { transform: translateX(50px) scale(1.1); } }
@keyframes riseUp { to { bottom: 120%; } }

/* Game 6: Cups & Ball (Hide Memory) */
.cups-container { display: flex; justify-content: center; gap: 2rem; perspective: 1000px; margin-bottom: 2rem; flex-wrap: wrap; }
.cup-card { width: 120px; height: 120px; cursor: pointer; position: relative; }
.cup-inner { width: 100%; height: 100%; position: absolute; transition: transform 0.6s; transform-style: preserve-3d; border-radius: var(--border-radius); box-shadow: var(--shadow-soft); }
.cup-card.hidden-state .cup-inner { transform: rotateY(180deg); }
.cup-front, .cup-back { width: 100%; height: 100%; position: absolute; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; font-size: 5rem; border-radius: var(--border-radius); background: var(--card-bg); border: 3px solid var(--primary-light); }
.cup-back { background: var(--accent-light); transform: rotateY(180deg); border-color: var(--accent-color); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.shake-anim { animation: shake 0.5s ease-in-out; }

/* Mascot & Decor Animations */
@keyframes floatMascot { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes blinkMascot { 0%, 4%, 8%, 100% { transform: scaleY(1); } 2%, 6% { transform: scaleY(0.1); } }
@keyframes popSpeech { 0% { transform: scale(0); opacity: 0; transform-origin: left center; } 100% { transform: scale(1); opacity: 1; transform-origin: left center; } }
@keyframes twinkle { 0% { opacity: 0.2; transform: scale(0.8); } 100% { opacity: 0.8; transform: scale(1.2); } }
@keyframes floatCloud { 0% { transform: translateX(0); } 50% { transform: translateX(-30px); } 100% { transform: translateX(0); } }

@media (max-width: 768px) {
    .app-header { padding: 1.5rem 5%; }
    .header-top { flex-direction: column; gap: 1rem; }
    .header-spacer { display: none; }
    .memory-grid { grid-template-columns: repeat(3, 1fr); }
    .cups-container { gap: 1rem; }
    .cup-card { width: 90px; height: 90px; }
    .cup-front, .cup-back { font-size: 3.5rem; }
    .text-opt { font-size: 1.3rem; padding: 0.8rem 1.5rem;}
    
    .wavy-lesson-item:nth-child(odd), .wavy-lesson-item:nth-child(even) {
        transform: translateX(0);
    }
}

/* Interactive Scene Styles */
.interactive-scene-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    border: 3px dashed var(--primary-light);
}
.interactive-scene {
    width: 100%;
    max-width: 600px;
    height: auto;
}
.interactive-room {
    cursor: pointer;
    transition: filter 0.3s ease;
}
.interactive-room:hover {
    filter: brightness(1.1) drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.2));
}
.interactive-room-label {
    pointer-events: none;
}

/* Footer Section */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color var(--transition-speed);
}

.app-footer a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.exercise-page {
    color: #333;
}

/* Fix faded text inside lessons */
.lesson-content {
    color: #333 !important;
}

.lesson-content label {
    color: #333 !important;
}

.lesson-content input {
    color: #E91E63;
}



/* =========================================
   AI Translator Bot Styles
   ========================================= */
.ai-bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Cairo', sans-serif;
}

.ai-bot-toggle {
    background-color: #6C5CE7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-bot-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
}

.ai-bot-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
    border: 2px solid #6C5CE7;
}

.ai-bot-panel.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
}

.ai-bot-header {
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-bot-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.ai-bot-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.ai-bot-close:hover {
    background: rgba(255,255,255,0.4);
}

.ai-bot-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

#ai-bot-input {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

#ai-bot-input:focus {
    border-color: #6C5CE7;
}

.ai-bot-actions {
    display: flex;
    gap: 10px;
}

.ai-bot-btn {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    font-size: 1rem;
}

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

.btn-translate {
    background: #4CAF50;
    color: white;
}

.btn-translate:hover {
    background: #45a049;
}

.btn-speak {
    background: #FF9800;
    color: white;
}

.btn-speak:hover:not([disabled]) {
    background: #F57C00;
}

.btn-speak[disabled] {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.ai-bot-result {
    min-height: 50px;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}
