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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(140deg,#4254b8 30%,#ff0000 50%, #f3e73f  60%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    color: white;
    position: relative;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Speaker Selector */
.speaker-selector {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speaker-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.speaker-dropdown {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.speaker-dropdown:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.speaker-dropdown:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.speaker-dropdown option {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 0.5rem;
}

/* Main content */
.main-content {
    padding: 2rem 0;
}

/* Introduction section */
.intro-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.intro-content h2 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.intro-content p {
    color: #718096;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Controls section */
.controls-section {
    margin-bottom: 2rem;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.control-btn.primary {
    background: linear-gradient(180deg, #5c970f 0%, #13a838 90%);
    color: white;
}

.control-btn.secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

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

.control-btn.playing {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
    }
}

.btn-icon {
    font-size: 1.2rem;
}

/* Toggle switch */
.view-toggle {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: rgba(255, 255, 255, 0.6);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(25px);
}

/* Alphabet section */
.alphabet-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.letter-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.letter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.5s ease;
}

.letter-card:hover::before {
    left: 100%;
}

.letter-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.letter-written {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.letter-sound {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    opacity: 0.8;
}

.letter-card.playing {
    background: linear-gradient(135deg, #ffffff 0%, #ff3636 100%);
    color: white;
    transform: scale(1.05);
}

.letter-card.playing .letter-written,
.letter-card.playing .letter-sound {
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #718096;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #2d3748;
}

.letter-detail {
    text-align: center;
}

.letter-display {
    margin-bottom: 2rem;
}

.letter-display .letter-written {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.letter-cases {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.uppercase, .lowercase {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 600;
}

.letter-info h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.letter-info span {
    color: #667eea;
    font-weight: 600;
}

.play-btn {
    background: linear-gradient(135deg, #ddf8fa 0%, #a24b4b 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25, 206, 107, 0.4);
}

.play-icon {
    font-size: 1.2rem;
}

/* Practice section */
.practice-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.practice-section.hidden {
    display: none;
}

.practice-content h2 {
    color: #4a5568;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.practice-question {
    text-align: center;
    margin-bottom: 2rem;
}

.practice-question p {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 1rem;
}

.practice-play-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.practice-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.practice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.practice-option {
    background: #f7fafc;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
}

.practice-option:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.practice-option.correct {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-color: #38a169;
}

.practice-option.incorrect {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border-color: #e53e3e;
}

.practice-feedback {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 500;
    min-height: 2rem;
}

.practice-feedback.correct {
    color: #38a169;
}

.practice-feedback.incorrect {
    color: #e53e3e;
}

.practice-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgb(0, 0, 0);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .speaker-selector {
        position: static;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .letter-card {
        padding: 1rem 0.5rem;
    }
    
    .letter-written {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-btn {
        justify-content: center;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
    
    .letter-cases {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .intro-section,
    .alphabet-section,
    .practice-section {
        padding: 1.5rem;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .letter-written {
        font-size: 1.8rem;
    }
    
    .letter-sound {
        font-size: 0.8rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Accessibility */
.letter-card:focus,
.control-btn:focus,
.play-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .letter-card {
        border: 2px solid #000;
    }
    
    .letter-written {
        color: #000;
    }
    
    .letter-sound {
        color: #333;
    }
}

.footer .copyright {
    font-size: 0.8em;
    color: #888; /* optional – makes it a little lighter */
    margin-top: 10px;
line-height: 1.4;
}