:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --tertiary: #FFE66D;
    --bg-gradient: linear-gradient(135deg, #A8E6CF 0%, #DCEDC1 100%);
    --text-dark: #2C3E50;
    --white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="5" fill="%23FF6B6B" opacity="0.3"/><circle cx="80" cy="30" r="8" fill="%234ECDC4" opacity="0.3"/><circle cx="40" cy="80" r="6" fill="%23FFE66D" opacity="0.3"/></svg>') repeat;
    animation: drift 60s linear infinite;
}

@keyframes drift {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

.screen {
    min-height: 100vh;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Start Screen */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
    transform: translateY(0);
    animation: float 4s ease-in-out infinite;
}

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

h1 {
    font-size: 3rem;
    color: var(--primary);
    text-shadow: 2px 2px 0px var(--tertiary);
    margin-bottom: 1rem;
}

.glass-panel p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #555;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

input {
    padding: 1.2rem;
    font-size: 1.5rem;
    border: 3px solid var(--secondary);
    border-radius: 20px;
    text-align: center;
    outline: none;
    transition: all 0.3s;
    background: var(--white);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
    transform: scale(1.02);
}

button {
    cursor: pointer;
    border: none;
    font-size: 1.8rem;
    font-weight: 800;
    padding: 1rem 2rem;
    border-radius: 20px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
}

.btn-primary {
    background: var(--primary);
    box-shadow: 0 6px 0 #d9534f;
}

.btn-primary:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #d9534f;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #d9534f;
    background: #ff5252;
}

.btn-secondary {
    background: var(--secondary);
    box-shadow: 0 6px 0 #31a69e;
    margin-top: 2rem;
    font-size: 1.5rem;
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #31a69e; }
.btn-secondary:active { transform: translateY(6px); box-shadow: 0 0 0 #31a69e; }

/* Lesson Screen */
header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    padding: 1rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

header h2 {
    color: var(--primary);
    font-size: 2.2rem;
}

.greeting-badge {
    background: var(--tertiary);
    color: var(--text-dark);
    padding: 0.5rem 1.5rem;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #e0c84c;
}

.lesson-container {
    width: 100%;
    max-width: 1200px;
    flex-grow: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border-radius: 25px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: var(--secondary);
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(78,205,196,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before { opacity: 1; }

.word-pair {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.word-box {
    text-align: center;
    flex: 1;
}

.word-ar {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.word-en {
    font-size: 1.2rem;
    color: #888;
    font-family: sans-serif;
    display: block;
}

.vs {
    font-size: 2rem;
    color: var(--tertiary);
    font-weight: 900;
}

.play-icon {
    font-size: 2rem;
    background: var(--tertiary);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-top: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover .play-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--secondary);
    color: white;
}

.card-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    padding: 10px;
    border: 2px dashed #eee;
}

/* Utilities */
.hidden { display: none !important; }

/* Animations */
.bounce-in {
    animation: bounceIn 1s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.fade-in { animation: fadeIn 1s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fade-in-up { animation: fadeInUp 1s ease-out; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

#welcome-message {
    margin-top: 2rem;
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
}

@media (max-width: 768px) {
    header { flex-direction: column; gap: 1rem; text-align: center; }
    .word-ar { font-size: 2rem; }
    h1 { font-size: 2.2rem; }
}
