/* ==========================================
   ALPHABET PAGE STYLES
   ========================================== */

:root {
    --bg-primary: #f0f0f0;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-color-hover: rgba(0, 0, 0, 0.3);
}

body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-color-hover: rgba(0, 0, 0, 0.7);
}

body {
    background: var(--bg-primary);
    transition: background 0.3s ease;
}

.container {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px var(--shadow-color-hover);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    margin: 20px auto;
}

h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: clamp(24px, 5vw, 48px);
    transition: color 0.3s ease;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.control-btn {
    padding: 15px 30px;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: #888888;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color-hover);
    background: #666666;
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: #4CAF50;
}

.speed-display {
    font-size: clamp(14px, 2vw, 18px);
    font-weight: bold;
    color: var(--text-primary);
    padding: 10px 20px;
    background: var(--shadow-color);
    border-radius: 8px;
    transition: background 0.3s ease, color 0.3s ease;
}

.grid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 800px;
}

.letter {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 4vw, 48px);
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
    user-select: none;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.letter:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-color-hover);
}

.letter.selected {
    transform: scale(1.5);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.9), 0 0 80px currentColor;
    animation: pulse 0.5s ease;
    z-index: 10;
    position: relative;
}

@keyframes pulse {
    0%, 100% { transform: scale(1.5); }
    50% { transform: scale(1.6); }
}

/* Pronunciation group colors */
.group-ee {
    background: #DC2626;
}

.group-ay {
    background: #7C3AED;
}

.group-ai {
    background: #2563EB;
}

.group-oh {
    background: #059669;
}

.group-yoo {
    background: #EA580C;
}

.group-consonant {
    background: #DB2777;
}

/* Dark mode colors */
body.dark-mode .group-ee {
    background: #F43F5E;
}

body.dark-mode .group-ay {
    background: #10B981;
}

body.dark-mode .group-ai {
    background: #06B6D4;
}

body.dark-mode .group-oh {
    background: #84CC16;
}

body.dark-mode .group-yoo {
    background: #A78BFA;
}

body.dark-mode .group-consonant {
    background: #FB923C;
}

.instructions {
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(12px, 2vw, 16px);
    line-height: 1.8;
    transition: color 0.3s ease;
}

.instructions p {
    margin: 5px 0;
}

/* Tablet styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .alphabet-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 700px;
        gap: 15px;
    }
    
    .container {
        padding: 40px;
    }
}

/* Phone styles (below 768px) */
@media (max-width: 767px) {
    .alphabet-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .container {
        padding: 20px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .control-btn {
        padding: 12px 20px;
    }
    
    .letter.selected {
        transform: scale(1.3);
    }
    
    @keyframes pulse {
        0%, 100% { transform: scale(1.3); }
        50% { transform: scale(1.4); }
    }
}

/* TV/Large screen styles (above 1400px) */
@media (min-width: 1400px) {
    .alphabet-grid {
        grid-template-columns: repeat(7, 1fr);
        max-width: 1000px;
        gap: 20px;
    }
    
    .container {
        padding: 50px;
    }
    
    .letter {
        font-size: 64px;
    }
    
    h1 {
        font-size: 64px;
        margin-bottom: 40px;
    }
    
    .letter.selected {
        transform: scale(1.7);
    }
    
    @keyframes pulse {
        0%, 100% { transform: scale(1.7); }
        50% { transform: scale(1.8); }
    }
}
