/* Styles pour le simulateur de dyslexie */
.dyslexia-game {
    position: relative;
}

/* ==========================
   JEU DYS V2 - DESIGN MODERNE
   ========================== */
.dyslexia-game-v2 {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.game-header {
    background: linear-gradient(135deg, var(--color-dark, #2c3e50) 0%, var(--color-mid, #3498db) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.game-logo {
    margin-bottom: 1rem;
}

.game-logo img {
    max-width: 400px;
    max-height: 100px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.dyslexia-game-v2 h3 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.level {
    padding: 2rem;
    border-bottom: 1px solid #eee;
    position: relative;
}

.level:last-child {
    border-bottom: none;
}

.level h4 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    color: var(--color-dark, #2c3e50);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.level h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--color-mid, #3498db);
    margin-right: 12px;
    border-radius: 2px;
}

.dyslexic-text {
    background: var(--color-light, #ecf0f1);
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    border-left: none;
    font-family: 'Courier New', monospace;
}

.quiz-text, .qa-block {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: none;
}

.qa-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.qa-item:last-child {
    margin-bottom: 0;
}

.question {
    font-weight: 600;
    color: var(--color-dark, #2c3e50);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.quiz-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

/* NIVEAU 1: les champs à trous ne doivent pas prendre toute la ligne */
.dyslexia-game-v2 .level-1 .quiz-text .quiz-input {
    width: auto;
    display: inline-block;
    min-width: 120px;
}

/* NIVEAUX 2/3 (questions/réponses): conserver les champs pleine largeur */
.dyslexia-game-v2 .qa-block .quiz-input {
    width: 100%;
}

.quiz-input:focus {
    outline: none;
    border-color: var(--color-mid, #3498db);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.quiz-input.correct {
    border-color: #28a745;
    background: #d4edda;
}

.quiz-input.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.quiz-controls {
    text-align: center;
    margin: 1.5rem 0;
}

/* STYLE UNIFIÉ POUR TOUS LES BOUTONS - SANS !important */
.dyslexia-game-v2 .check-answers-btn-v2,
.dyslexia-game .quiz-controls button,
.dyslexia-game-v2 .quiz-controls button,
.dyslexia-game-v2 .finish-btn-v2,
.dyslexia-game-v2 .next-level-btn-v2,
.dyslexia-game-v2 .prev-level-btn-v2,
.dyslexia-game .check-answers-btn,
.dyslexia-game .show-solution-btn,
.dyslexia-game .new-game-btn {
    background: var(--color-mid, #3498db);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0.5rem;
}

.dyslexia-game-v2 .check-answers-btn-v2:hover,
.dyslexia-game .quiz-controls button:hover,
.dyslexia-game-v2 .quiz-controls button:hover,
.dyslexia-game-v2 .finish-btn-v2:hover,
.dyslexia-game-v2 .next-level-btn-v2:hover,
.dyslexia-game-v2 .prev-level-btn-v2:hover,
.dyslexia-game .check-answers-btn:hover,
.dyslexia-game .show-solution-btn:hover,
.dyslexia-game .new-game-btn:hover {
    background: var(--color-light, #ecf0f1);
    color: #222;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.results {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #e9ecef;
}

.score h4 {
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    color: var(--color-light, #ecf0f1);
    text-align: center;
}

.feedback ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feedback li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.95rem;
}

.feedback li:last-child {
    border-bottom: none;
}

.global-score {
    background: #ffffff;
    padding: 2rem;
    text-align: center;
    border-top: 3px solid var(--color-mid, #3498db);
}

/* Bouton de fin de jeu - seule la marge top spécifique */
.finish-btn-v2 {
    margin-top: 1.5rem;
}

/* Navigation entre niveaux */
.navigation-controls {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.prev-level-btn-v2 {
    background: var(--color-dark, #2c3e50);
}

.prev-level-btn-v2:hover {
    background: var(--color-mid, #3498db);
}

/* Barre de navigation entre niveaux */
.level-navigation-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.nav-level-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-level-btn:hover {
    background: var(--color-mid, #3498db);
    transform: translateY(-2px);
}

.nav-level-btn.active {
    background: var(--color-dark, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.total-score h4 {
    font-size: 1.8rem;
    margin: 30px 0;
    color: var(--color-dark, #2c3e50);
}

/* Animation des mots dyslexiques */
.dyslexic-word {
    display: inline-block;
    transition: all 0.2s ease;
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .dyslexia-game-v2 {
        margin: 1rem;
        border-radius: 15px;
    }
    
    .game-header {
        padding: 1.5rem;
    }
    
    .level {
        padding: 1.5rem;
    }
    
    .dyslexia-game-v2 h3 {
        font-size: 2rem;
    }
    
    .game-logo img {
        max-width: 300px;
        max-height: 75px;
    }
}

/* Barre de progression */
.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.progress-text {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.progress-fill {
    height: 8px;
    background: linear-gradient(45deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.dyslexia-game {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dyslexia-game h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.dyslexia-game h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #f8f9fa;
    font-weight: 600;
}

/* Section du texte dyslexique */
.dyslexic-text-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dyslexic-text {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: justify;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--color-dark, #2c3e50);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Section du quiz */
.quiz-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quiz-text {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: none;
}

/* Champs de saisie du quiz */
.quiz-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1rem;
    color: #333;
    min-width: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.quiz-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    background: white;
    transform: translateY(-2px);
}

.quiz-input.focused {
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.25);
}

.quiz-input.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.quiz-input.incorrect {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.quiz-input.solution {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #856404;
    font-weight: bold;
}

/* Boutons de contrôle */
.quiz-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

/* Tous les autres styles redondants supprimés - style unifié défini plus haut */

/* Résultats */
.results {
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.score h4 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-light, #ecf0f1);
    text-shadow: none;
}

/* Forcer le style sur la version V2 */
.dyslexia-game-v2 .score h4 {
    color: var(--color-light, #ecf0f1) !important;
    text-shadow: none !important;
}

.feedback ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feedback li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
}

.feedback li:last-child {
    border-bottom: none;
}

/* Timer (optionnel) */
.timer-display {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid #ffd700;
}

/* Responsive design */
@media (max-width: 768px) {
    .dyslexia-game {
        margin: 1rem;
        padding: 1rem;
        border-radius: 15px;
    }
    
    .dyslexia-game h3 {
        font-size: 2rem;
    }
    
    .dyslexic-text, .quiz-text {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .quiz-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .quiz-controls button {
        width: 100%;
        max-width: 300px;
    }
    
    .quiz-input {
        min-width: 80px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .dyslexia-game {
        padding: 0.8rem;
    }
    
    .dyslexic-text-section, .quiz-section {
        padding: 1rem;
    }
    
    .dyslexic-text, .quiz-text {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dyslexia-game {
    animation: fadeInUp 0.8s ease-out;
}

/* Effets de survol pour les champs de saisie */
.quiz-input:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Style pour les mots transformés (simulation dyslexie) */
.dyslexic-text {
    position: relative;
}

/* Animation de mélange continu pour les mots dyslexiques */
.dyslexic-text .dyslexic-word {
    display: inline-block;
    transition: all 0.2s ease;
    animation: dyslexicShuffle 1s infinite;
    position: relative;
}

@keyframes dyslexicShuffle {
    0% { 
        transform: scale(1) rotate(0deg); 
        filter: blur(0px);
    }
    25% { 
        transform: scale(1.02) rotate(0.5deg); 
        filter: blur(0.2px);
    }
    50% { 
        transform: scale(0.98) rotate(-0.5deg); 
        filter: blur(0.1px);
    }
    75% { 
        transform: scale(1.01) rotate(0.3deg); 
        filter: blur(0.3px);
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        filter: blur(0px);
    }
}

/* Animation plus intense pour certains mots */
.dyslexic-text .dyslexic-word:nth-child(odd) {
    animation-duration: 0.8s;
    animation-delay: 0.1s;
}

.dyslexic-text .dyslexic-word:nth-child(even) {
    animation-duration: 1.2s;
    animation-delay: 0.2s;
}

.dyslexic-text .dyslexic-word:nth-child(3n) {
    animation-duration: 1s;
    animation-delay: 0.3s;
}



/* Amélioration de l'accessibilité */
.quiz-input:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Supprimer les placeholders */
.quiz-input::placeholder {
    opacity: 0;
}

/* Mode sombre optionnel */
@media (prefers-color-scheme: dark) {
    .dyslexia-game {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .quiz-input {
        background: rgba(52, 73, 94, 0.9);
        color: #ecf0f1;
    }
    
    .quiz-input:focus {
        background: #2c3e50;
    }
}

/* Styles d'impression */
@media print {
    .dyslexia-game {
        background: white;
        color: black;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .quiz-controls, .results {
        display: none;
    }
}
