/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Navigation Menu */
.navigation-menu {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: white;
    border: 3px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 100px;
}

.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.nav-icon {
    font-size: 1.8rem;
}

.nav-label {
    font-size: 0.9rem;
    font-weight: bold;
}

.nav-item.active .nav-label {
    color: white;
}

@media (max-width: 600px) {
    .nav-item {
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
    
    .nav-label {
        font-size: 0.8rem;
    }
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: white;
    font-size: 1.5rem;
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Welcome Page */
.welcome-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.welcome-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

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

.welcome-title {
    font-size: 2.5rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-subtitle {
    font-size: 1.3rem;
    color: #764ba2;
    text-align: center;
    margin-bottom: 30px;
}

/* Form Styles */
.setup-form, .settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.age-select, .number-select {
    padding: 15px;
    font-size: 1.1rem;
    border: 3px solid #667eea;
    border-radius: 15px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', sans-serif;
}

.age-select:hover, .number-select:hover {
    border-color: #764ba2;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 25px;
    height: 25px;
    cursor: pointer;
}

/* Buttons */
.start-button, .save-button, .primary-button {
    padding: 20px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.4);
    font-family: 'Comic Sans MS', sans-serif;
}

.start-button:hover, .save-button:hover, .primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(245, 87, 108, 0.5);
}

.start-button:active, .save-button:active, .primary-button:active {
    transform: translateY(0);
}

.settings-button, .cancel-button, .secondary-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    color: #667eea;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-family: 'Comic Sans MS', sans-serif;
}

.settings-button:hover, .cancel-button:hover, .secondary-button:hover {
    background: #667eea;
    color: white;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.stat-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Session Page */
.session-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.session-header {
    text-align: center;
    margin-bottom: 30px;
}

.progress-indicator {
    background: white;
    color: #667eea;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.flashcard {
    background: white;
    width: 100%;
    max-width: 600px;
    min-height: 300px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.flashcard.flip {
    transform: rotateY(10deg) scale(0.95);
}

.word-display {
    font-size: 5rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    padding: 40px;
    font-family: 'Arial Black', Arial, sans-serif;
}

/* Timer */
.timer-container {
    width: 100%;
    max-width: 600px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 1s linear;
    border-radius: 15px;
}

.timer-text {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Response Buttons */
.button-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

.response-button {
    padding: 30px;
    font-size: 1.8rem;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-family: 'Comic Sans MS', sans-serif;
}

.correct-button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.correct-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(56, 239, 125, 0.4);
}

.incorrect-button {
    background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
}

.incorrect-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(252, 74, 26, 0.4);
}

/* Results Page */
.results-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.results-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.6s ease-out;
}

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

.celebration-header {
    text-align: center;
    margin-bottom: 40px;
}

.celebration-emoji {
    font-size: 5rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.results-title {
    font-size: 2.5rem;
    color: #667eea;
    margin-top: 20px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.result-item.correct {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.result-item.mastered {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.result-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.encouragement-message {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: bold;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Settings Page */
.settings-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.settings-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.settings-title {
    font-size: 2.5rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.danger-zone {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px dashed #fc4a1a;
}

.danger-zone h3 {
    color: #fc4a1a;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.reset-button {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', sans-serif;
}

.reset-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(252, 74, 26, 0.4);
}

.danger-note {
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-title, .results-title, .settings-title {
        font-size: 2rem;
    }
    
    .word-display {
        font-size: 3rem;
    }
    
    .response-button {
        font-size: 1.3rem;
        padding: 20px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
}





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

.mastered-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

.page-title {
    font-size: 2.5rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
}

.mastered-stats {
    text-align: center;
    margin-bottom: 30px;
}

.stat-badge {
    display: inline-flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.3);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.stat-text {
    font-size: 1.2rem;
    margin-top: 5px;
}

.filter-section {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 3px solid #667eea;
    border-radius: 15px;
    font-family: 'Comic Sans MS', sans-serif;
}

    .search-input:focus {
        outline: none;
        border-color: #764ba2;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    }

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

.word-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

    .word-card:hover {
        transform: translateY(-5px);
    }

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.word-text {
    font-size: 2rem;
    font-weight: bold;
}

.mastered-badge {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 10px;
    border-radius: 10px;
}

.word-stats {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9rem;
}

.stat-label {
    opacity: 0.9;
}

.stat-value {
    font-weight: bold;
}

.undo-button {
    width: 100%;
    padding: 10px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', sans-serif;
}

    .undo-button:hover {
        background: #f8f9fa;
        transform: scale(1.05);
    }

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .words-grid {
        grid-template-columns: 1fr;
    }
}