/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: ltr;
}

/* Header styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.site-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin-right: 5px;
}

.nav-btn {
    padding: 6px 12px;
    border-radius: 18px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.learn-btn {
    background: #10b981;
    color: white;
}

.practice-btn {
    background: #f59e0b;
    color: white;
}

.write-btn {
    background: #8b5cf6;
    color: white;
}

.play-btn {
    background: #ef4444;
    color: white;
}

.stories-btn {
    background: #ec4899;
    color: white;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-buttons {
    display: flex;
    align-items: center;
}

.login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    font-size: 0.75rem;
}

.user-status {
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
}

.user-badge {
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.3s ease;
    margin-left: 2px;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Mobile responsive header */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
    }

    .nav-menu {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .user-info {
        font-size: 0.7rem;
    }

    .nav-label {
        font-size: 0.75rem;
    }
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 30px;
}

.logo {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.site-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.site-title:hover {
    color: #764ba2;
}

.menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px;
}

.menu li {
    list-style: none;
}

.menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.menu a:hover {
    background: #667eea;
    color: white;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: none;
    border: none;
    color: #333;
    font-weight: 500;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.dropbtn:hover {
    background: #667eea;
    color: white;
}

.caret {
    margin-left: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-radius: 12px;
    overflow: hidden;
    top: 100%;
    left: 0;
    margin-top: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Show dropdown on hover for desktop */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Show dropdown when active class is added (for mobile) */
.dropdown.active .dropdown-content {
    display: block;
}

/* Add a pseudo-element to bridge the gap between button and dropdown */
.dropdown:hover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
    z-index: 999;
}

.dropdown-content a {
    color: #333;
    padding: 14px 18px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateX(3px);
}

/* Main content */
.main-content {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.main-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    direction: rtl;
}

.main-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.main-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Game options */
.game-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.option-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #333;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.option-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #667eea;
    direction: rtl;
}

.option-card p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #666;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Loading animation */
#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
}

/* CSS Loading Spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#lottie {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: none;
}

/* Alphabet specific styles */
.alphabet a {
    font-weight: 600;
}

.learn-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.practice-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.write-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.play-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.stories-btn {
    background: linear-gradient(135deg, #E91E63, #C2185B);
}

/* Learning content styles */
.arabic-alphabet {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.letter-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.letter-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.arabic-letter {
    font-size: 3rem;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.letter-name {
    font-size: 0.9rem;
    color: #666;
}

/* Practice content styles */
.practice-area {
    max-width: 800px;
    margin: 0 auto;
}

.practice-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin: 20px 0;
    text-align: center;
    color: #333;
}

.practice-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.practice-buttons .practice-btn {
    font-size: 2rem;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    min-height: 80px;
}

.practice-buttons .practice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Games content styles */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 40px auto;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: #333;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.game-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.game-card p {
    margin-bottom: 20px;
    color: #666;
}

/* About content styles */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    color: #333;
    line-height: 1.6;
}

.about-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        text-align: center;
        position: relative;
    }

    .menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        order: 2;
    }

    .menu li {
        margin: 0;
    }

    .logo {
        height: 40px;
        order: 1;
    }

    .main-content h1 {
        font-size: 2rem;
    }

    .main-content h2 {
        font-size: 1.5rem;
    }

    .game-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .letter-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }

    .letter-card {
        padding: 15px;
    }

    .arabic-letter {
        font-size: 2.5rem;
    }

    .practice-buttons {
        gap: 10px;
    }

    .practice-buttons .practice-btn {
        min-width: 60px;
        min-height: 60px;
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Lesson page styles */
.lesson-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lesson-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.nav-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.lesson-body {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #333;
}

.lesson-body h1 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.lesson-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

.instruction {
    font-weight: bold;
    color: #764ba2;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.letter-item {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.letter-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.letter-item .arabic-letter {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.letter-item .letter-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Original-style Alphabet Layout */
.alphabet {
    margin: 20px 0;
    direction: rtl;
    /* Right-to-left for Arabic */
}

.alphabet ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
}

.alphabet ul li {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.alphabet ul li:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.alphabet ul li:active {
    transform: translateY(0) scale(1.05);
}

/* Learn page structure */
#learn {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.progress {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.nav span.disabled {
    color: #ccc;
    font-weight: 500;
}

.nav button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.highlight {
    color: #667eea;
    font-weight: bold;
}

.click-sound {
    display: block;
    margin: 15px 0;
    font-style: italic;
    color: #666;
}

/* Practice page styles */
.practice-instructions {
    background: rgba(102, 126, 234, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.practice-instructions p {
    margin-bottom: 10px;
    font-weight: 500;
}

.word-practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.word-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.word-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.letter-display {
    font-size: 3rem;
    color: #667eea;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.letter-display:hover {
    transform: scale(1.1);
    color: #764ba2;
}

.word-display {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    direction: rtl;
    font-weight: 500;
}

.word-display:hover {
    color: #667eea;
}

.word-image {
    cursor: pointer;
    transition: all 0.3s ease;
}

.placeholder-image {
    font-size: 3rem;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.word-image:hover .placeholder-image {
    transform: scale(1.2);
}

.practice-summary {
    background: rgba(118, 75, 162, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-top: 30px;
    border-left: 4px solid #764ba2;
    font-style: italic;
    text-align: center;
}

/* Game page styles */
.game-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-header h1 {
    color: #667eea;
    margin-bottom: 15px;
}

.game-instructions {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #333;
}

.score-board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    font-weight: bold;
    color: #667eea;
    flex-wrap: wrap;
}

.score-board span {
    font-size: 1.1rem;
}

.score-board #score,
.score-board #matches,
.score-board #timer {
    color: #764ba2;
    font-size: 1.3rem;
}

.score-board .btn,
#reset-game {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.score-board .btn:hover,
#reset-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.words-column,
.letters-column {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.words-column h3,
.letters-column h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
}

.word-list,
.letter-list {
    display: grid;
    gap: 15px;
}

.word-list .word-item {
    background: linear-gradient(135deg, #f8f9ff, #e8f0ff);
    padding: 15px;
    border-radius: 12px;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.word-list .word-item:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8f0ff, #f0f4ff);
}

.word-list .word-item.matched {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #4CAF50;
    border-style: solid;
}

.word-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    direction: rtl;
    margin-bottom: 5px;
}

.word-meaning {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.letter-list .letter-item {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.letter-list .letter-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.letter-list .letter-item:active {
    cursor: grabbing;
}

.letter-list .letter-item.selected {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    transform: scale(1.1);
}

.letter-list .letter-item.matched {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    cursor: default;
    opacity: 0.7;
}

.game-results {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-results h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.game-results p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 30px;
}

/* Shake animation for incorrect matches */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Responsive design for lesson and game pages */
@media (max-width: 768px) {
    .lesson-nav {
        flex-direction: column;
        gap: 15px;
    }

    .alphabet-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }

    .letter-item .arabic-letter {
        font-size: 2rem;
    }

    .word-practice-grid {
        grid-template-columns: 1fr;
    }

    .game-board {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .score-board {
        flex-direction: column;
        gap: 15px;
    }

    .word-text {
        font-size: 1.2rem;
    }

    .letter-list .letter-item {
        font-size: 1.5rem;
        padding: 15px;
    }
}

/* Enhanced Index Page Styles */
.hero-section {
    text-align: center;
    padding: 40px 20px 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-text {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.arabic-title {
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    direction: rtl;
    color: #fff;
    font-family: 'Arial Unicode MS', 'Tahoma', sans-serif;
}

.main-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.hero-description {
    font-size: 1.3rem;
    margin-bottom: 10px;
    opacity: 0.95;
    color: #fff;
    font-weight: 500;
}

.hero-subtext {
    font-size: 1.1rem;
    opacity: 0.85;
    color: #fff;
    font-style: italic;
}

.features-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

/* Tablet responsive */
@media (max-width: 992px) {
    .features-section {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
    }
}

/* Large mobile responsive */
@media (max-width: 768px) {
    .features-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 35px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: #333;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.learn-card:hover::before {
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

.practice-card:hover::before {
    background: linear-gradient(90deg, #FF9800, #F57C00);
}

.play-card:hover::before {
    background: linear-gradient(90deg, #9C27B0, #7B1FA2);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.feature-card p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #666;
    flex-grow: 1;
}

.feature-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.learn-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.learn-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.practice-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.practice-btn:hover {
    background: linear-gradient(135deg, #F57C00, #FF9800);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.write-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.write-btn:hover {
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

.play-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.play-btn:hover {
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

.info-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #fff;
}

.info-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Responsive improvements for index page */
@media (max-width: 768px) {
    .hero-text {
        padding: 25px;
        margin: 0 10px 20px;
    }

    .arabic-title {
        font-size: 2.2rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .features-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .feature-card {
        padding: 25px 20px;
    }

    .feature-icon {
        font-size: 2.8rem;
    }

    .info-section {
        padding: 0 15px 30px;
    }

    .info-card {
        padding: 20px;
    }
}