:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --tertiary: #FFE66D;
    --dark: #2C3E50;
    --light: #F7FFF7;
    --gradient-bg: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

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

body {
    background: var(--gradient-bg);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--dark);
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 10;
}

.screen.hidden {
    display: none;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 500px;
    width: 90%;
    z-index: 2;
}

/* Typography & Animations */
h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--dark);
}

.bounce-in {
    animation: bounceIn 1s cubic-bezier(0.28, 0.84, 0.42, 1);
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }

/* Input & Buttons */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input {
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--secondary);
    font-size: 1.2rem;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

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

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
    background: #ff5252;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Background Decorations */
.shape {
    position: absolute;
    filter: blur(50px);
    z-index: 1;
    border-radius: 50%;
    animation: float 10s infinite alternate;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    opacity: 0.5;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    opacity: 0.4;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--tertiary);
    top: 40%;
    left: 60%;
    opacity: 0.6;
    animation-duration: 15s;
}

/* Lesson Screen */
#lesson-screen {
    justify-content: flex-start;
    padding: 20px;
    overflow-y: auto;
}

header {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

header h2 {
    color: var(--dark);
    font-size: 1.5rem;
}

.lesson-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1200px;
    padding-bottom: 50px;
    z-index: 2;
}

.word-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.5s ease;
    animation-fill-mode: both;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}


.card-details {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: linear-gradient(to bottom, #ffffff, #fdfbfb);
}

.card-details h1 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 5px;
    line-height: 1.2;
}

.card-details h3 {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
}

.play-btn {
    margin-top: auto;
    font-size: 1.2rem;
    padding: 10px 25px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    align-self: center;
}

/* Animations */
@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); opacity: 1; }
}

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

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, 50px) rotate(20deg); }
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

.zoom-in {
    animation: zoomIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    font-size: 4rem;
    color: var(--dark);
    text-shadow: 0 4px 15px rgba(255, 255, 255, 0.8);
    text-align: center;
}

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

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #arabic-word {
        font-size: 2.5rem;
    }
    
    #english-word {
        font-size: 1.3rem;
    }
    
    .image-container {
        height: 250px;
    }
}
