/* Kid-Friendly Word Learning Website Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables */
:root {
    --color-green: #4CAF50;
    --color-green-alt: #66BB6A;
    --color-blue: #2196F3;
    --color-orange: #FF9800;
    --color-orange-deep: #F57C00;
    --color-pink: #E91E63;
    --color-purple: #9C27B0;
    --color-red: #f44336;
    --color-dark: #333;
    --color-nav: #FF6B6B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --gradient-header: linear-gradient(45deg, var(--color-green), var(--color-blue));
}

/* Accessibility helpers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.btn:focus, .word-btn:focus, .letter-option:focus, .floating-game-btn:focus, nav a:focus {
    outline: 3px solid var(--color-blue);
    outline-offset: 2px;
}

body {
    font-family: 'Verdana', Geneva, Tahoma, sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

header {
    background: var(--gradient-header);
    color: white;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

header h1 { font-size: 2.5rem; margin-bottom: 0.5rem; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
header p { font-size: 1.2rem; opacity: 0.9; }

nav { background: var(--color-nav); padding: 1rem 0; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
nav ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }
nav a { color: white; text-decoration: none; padding: 0.8rem 1.5rem; background: rgba(255,255,255,0.2); border-radius: 25px; transition: all 0.3s ease; font-weight: bold; font-size: 1.1rem; }
nav a:hover { background: rgba(255,255,255,0.4); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
nav a.active { background: white; color: var(--color-nav); }

/* Utility feature classes */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.feature-box { padding: 1.5rem; border-radius: 15px; }
.feature-list { text-align: left; max-width: 600px; margin: 1rem auto; }
.language-flag { font-size: 2rem; margin-bottom: 0.5rem; }
.language-subtitle { font-size: 1rem; opacity: 0.9; }
.step-box { text-align: center; }
.step-number { font-size: 3rem; margin-bottom: 1rem; }
.step-box h3 { color: var(--color-green); }
.bg-soft-orange .step-box h3, .bg-soft-orange h3 { color: var(--color-orange) !important; }
.bg-soft-blue .step-box h3, .bg-soft-blue h3 { color: var(--color-blue) !important; }
.bg-soft-orange { background: #fff3e0; }
.bg-soft-green { background: #e8f5e8; }
.bg-soft-blue { background: #e3f2fd; }
.bg-soft-purple { background: #f3e5f5; }
.bg-soft-yellow { background: #fff9c4; }
.bg-soft-pink { background: #fce4ec; }
.bg-soft-grey { background: #f5f5f5; }
.bg-soft-lightblue { background: #e8f4fd; }

/* Sticky offset utility */
.words-container.sticky-offset { padding-top: 80px; }

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Home Page Styles */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.hero-section h2 {
    color: #4CAF50;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 2rem;
}

.language-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.language-btn {
    background: linear-gradient(45deg, #FF9800, #FF5722);
    color: white;
    border: none;
    padding: 2rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    min-width: 280px;
}

.language-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.language-btn.english {
    background: linear-gradient(45deg, #2196F3, #3F51B5);
}

.language-btn.french {
    background: linear-gradient(45deg, #E91E63, #9C27B0);
}

/* Word Page Styles */
.current-word-display {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #4CAF50;
    transition: all 0.3s ease;
    /* Hide by default until user scrolls to words section */
    display: none;
}

.current-word-display.sticky-active {
    position: sticky;
    top: 10px;
    z-index: 10;
    transform: scale(0.85);
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.2);
    border-color: #66BB6A;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: block;
}

.current-word-display.sticky-active::before {
    content: "📌";
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.7rem;
    opacity: 0.6;
}

.current-word-display.sticky-active p {
    font-size: 0.7rem;
    margin-top: 0.3rem;
    opacity: 0.8;
}

.current-word-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.current-word-display.sticky-active:hover {
    transform: scale(0.85) translateY(-1px);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.25);
}

.current-word {
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.current-word-display.sticky-active .current-word {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.current-phonics {
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

.current-word-display.sticky-active .current-phonics {
    font-size: 0.8rem;
}

/* Controls Section */
.controls {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.controls h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.search-bar, .filter-select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #333;
}

.search-bar:focus, .filter-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.control-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn.secondary {
    background: #FF9800;
}

.btn.secondary:hover {
    background: #f57c00;
}

.btn.primary {
    background: #2196F3;
}

.btn.primary:hover {
    background: #1976D2;
}

.btn.game {
    background: linear-gradient(45deg, #9C27B0, #E91E63);
}

.btn.game:hover {
    background: linear-gradient(45deg, #7B1FA2, #C2185B);
}

.btn.danger {
    background: #f44336;
}

.btn.danger:hover {
    background: #d32f2f;
}

/* Words Grid */
.words-container {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.word-btn {
    background: linear-gradient(45deg, #FFE082, #FFCC02);
    color: #333;
    border: none;
    padding: 1rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-family: inherit;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-height: 80px;
}

.word-text {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.2;
}

.word-phonics {
    font-size: 0.9rem;
    font-weight: normal;
    color: #666;
    text-transform: none;
    font-style: italic;
    line-height: 1;
}

.word-btn:hover {
    background: linear-gradient(45deg, #FFC107, #FF9800);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.word-btn:hover .word-phonics {
    color: #555;
}

.word-btn.favorite {
    background: linear-gradient(45deg, #E91E63, #AD1457);
    color: white;
}

.word-btn.favorite .word-phonics {
    color: #FFB6C1;
}

.word-btn.clicked {
    background: linear-gradient(45deg, #4CAF50, #2E7D32);
    color: white;
}

.word-btn.clicked .word-phonics {
    color: #C8E6C9;
}


/* About and Contact Sections */
.info-section {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.info-section h2 {
    color: #4CAF50;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.info-section p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    nav ul {
        flex-direction: row !important;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center !important;
    }
    
    nav a {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .language-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .language-btn {
        min-width: 250px;
        padding: 1.5rem 2rem;
        font-size: 1.3rem;
    }
    
    .current-word {
        font-size: 2.5rem;
    }
    
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.8rem;
    }
    
    .word-btn {
        padding: 1rem 0.8rem;
        font-size: 1rem;
        min-height: 85px;
        gap: 0.4rem;
    }
    
    .word-text {
        font-size: 1rem;
    }
    
    .word-phonics {
        font-size: 0.85rem;
        color: #666;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    /* Removed duplicate nav styles already covered by 1024px breakpoint */
}

@media (max-width: 480px) {
    main {
        padding: 0 0.5rem;
    }
    
    .hero-section, .controls, .words-container, .sidebar, .info-section {
        padding: 1.5rem;
    }
    
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.6rem;
    }
    
    .word-btn {
        padding: 0.8rem 0.5rem;
        min-height: 80px;
        gap: 0.3rem;
    }
    
    .word-text {
        font-size: 0.9rem;
    }
    
    .word-phonics {
        font-size: 0.75rem;
        color: #666;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.bounce {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Removed unused sidebar, favorites/history, filter tag, and word stats styles (no corresponding HTML elements) */

/* Word Game Modal Styles */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.game-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 3px solid #4CAF50;
    padding-bottom: 1rem;
}

.game-header h2 {
    color: #4CAF50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.score {
    color: #2196F3;
}

.timer {
    color: #FF9800;
    font-size: 1.4rem;
}

.close-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.game-content {
    text-align: center;
}

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

.current-game-word {
    font-size: 4rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.listen-btn {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.listen-btn:hover {
    background: linear-gradient(45deg, #F57C00, #E65100);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

.letter-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.letter-option {
    background: linear-gradient(45deg, #E3F2FD, #BBDEFB);
    border: 3px solid #2196F3;
    color: #1976D2;
    font-size: 2rem;
    font-weight: bold;
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-option:hover {
    background: linear-gradient(45deg, #BBDEFB, #90CAF9);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.3);
}

.letter-option.correct {
    background: linear-gradient(45deg, #C8E6C9, #A5D6A7);
    border-color: #4CAF50;
    color: #2E7D32;
    animation: correctPulse 0.6s ease;
}

.letter-option.wrong {
    background: linear-gradient(45deg, #FFCDD2, #EF9A9A);
    border-color: #f44336;
    color: #C62828;
    animation: wrongShake 0.6s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.game-feedback {
    min-height: 60px;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.feedback-correct {
    color: #4CAF50;
    animation: bounceIn 0.6s ease;
}

.feedback-wrong {
    color: #f44336;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.game-results {
    text-align: center;
    padding: 2rem 0;
}

.game-results h3 {
    color: #4CAF50;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.final-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 1rem;
}

.results-message {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Floating Game Button */
.floating-game-btn {
    position: fixed;
    bottom: 35px;
    right: 15px;
    width: 155px;
    height: 50px;
    background: linear-gradient(45deg, #FF9800, #E91E63);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    animation: pulseGame 2s infinite;
    font-family: 'Verdana', Geneva, Tahoma, sans-serif;
    white-space: nowrap;
}

.floating-game-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 152, 0, 0.6);
    background: linear-gradient(45deg, #F57C00, #C2185B);
}

.floating-game-btn:active {
    transform: scale(0.95);
}

@keyframes pulseGame {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Mobile optimization for floating button - only very small screens need adjustment */
@media (max-width: 480px) {
    .floating-game-btn {
        width: 125px;
        height: 45px;
        bottom: 30px;
        right: 10px;
        font-size: 1rem;
        gap: 5px;
    }
}
