/* Mon Livre Magique - Styles CSS */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;700&display=swap');

:root {
    /* Couleurs pastel */
    --bleu-tendre: #A7D7F9;
    --vert-doux: #B5EAD7;
    --rose-bonbon: #FFB7C5;
    --jaune-soleil: #FFDAC1;
    --violet-reve: #E2D1F9;
    --orange-creme: #FFB347;
    --lavande: #E6E6FA;
    --pêche: #FFDAB9;
    --menthe: #98FB98;
    --corail: #F08080;
    --ciel: #87CEEB;
    --citron: #FFFACD;
    --canard: #ACE1AF;
    --saumon: #FFA07A;
    --prune: #DDA0DD;
    
    /* Neutres */
    --blanc-coton: #FFFFFF;
    --gris-tres-doux: #F8F9FA;
    --gris-lisible: #6C757D;
    
    /* Pédagogiques */
    --digramme-vert: #4CAF50;
    --lettre-muette: #9E9E9E;
    --lettre-prononcee: #000000;
    
    /* Arc-en-ciel */
    --arc-rouge: #FF0000;
    --arc-orange: #FF7F00;
    --arc-jaune: #FFFF00;
    --arc-vert: #00FF00;
    --arc-bleu: #0000FF;
    --arc-indigo: #4B0082;
    --arc-violet: #9400D3;
    
    /* Ombres */
    --ombre-douce: 0 8px 32px rgba(0, 0, 0, 0.1);
    --ombre-floue: 0 4px 16px rgba(0, 0, 0, 0.05);
}

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

.mlm-container {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--gris-tres-doux) 0%, var(--bleu-tendre) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    padding: 20px;
}

/* Conteneur principal */
.mlm-app-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Formulaire */
.mlm-formulaire-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--blanc-coton);
    border-radius: 30px;
    box-shadow: var(--ombre-douce);
    overflow: hidden;
    animation: apparition 0.6s ease-out;
}

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

.mlm-en-tete-formulaire {
    background: linear-gradient(135deg, var(--rose-bonbon), var(--orange-creme));
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mlm-en-tete-formulaire::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: mouvement 20s linear infinite;
}

@keyframes mouvement {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.mlm-titre-formulaire {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3rem);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.mlm-sous-titre-formulaire {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}

.mlm-contenu-formulaire {
    padding: 40px 20px;
}

.mlm-etape-formulaire {
    margin-bottom: 40px;
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
}

.mlm-etape-formulaire:nth-child(1) { animation-delay: 0.1s; }
.mlm-etape-formulaire:nth-child(2) { animation-delay: 0.2s; }
.mlm-etape-formulaire:nth-child(3) { animation-delay: 0.3s; }
.mlm-etape-formulaire:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mlm-titre-etape {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mlm-icone-etape {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--ombre-floue);
    flex-shrink: 0;
}

.mlm-icone-etape.prenom {
    background: linear-gradient(135deg, var(--rose-bonbon), var(--saumon));
}

.mlm-icone-etape.genre {
    background: linear-gradient(135deg, var(--violet-reve), var(--lavande));
}

.mlm-icone-etape.theme {
    background: linear-gradient(135deg, var(--vert-doux), var(--menthe));
}

.mlm-icone-etape.niveau {
    background: linear-gradient(135deg, var(--jaune-soleil), var(--citron));
}

.mlm-texte-etape {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    color: var(--gris-lisible);
}

/* Champ prénom */
.mlm-champ-prenom {
    position: relative;
    margin-top: 10px;
}

.mlm-input-prenom {
    width: 100%;
    padding: 20px 25px 20px 70px;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    border: 3px solid var(--rose-bonbon);
    border-radius: 25px;
    background: var(--gris-tres-doux);
    transition: all 0.3s ease;
    outline: none;
    text-transform: uppercase;
}

.mlm-input-prenom:focus {
    border-color: var(--orange-creme);
    background: var(--blanc-coton);
    box-shadow: 0 0 0 4px rgba(255, 183, 197, 0.2);
    transform: translateY(-2px);
}

.mlm-icone-input {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    color: var(--rose-bonbon);
}

/* Options genre */
.mlm-options-genre {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.mlm-option-genre {
    position: relative;
    cursor: pointer;
}

.mlm-input-genre {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.mlm-carte-genre {
    background: var(--gris-tres-doux);
    border: 3px solid transparent;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.mlm-input-genre:checked + .mlm-carte-genre {
    border-color: var(--violet-reve);
    background: linear-gradient(135deg, rgba(226, 209, 249, 0.3), rgba(230, 230, 250, 0.3));
    transform: translateY(-5px);
    box-shadow: var(--ombre-douce);
}

.mlm-icone-genre {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
}

.mlm-icone-genre.fille {
    background: linear-gradient(135deg, var(--rose-bonbon), var(--pêche));
}

.mlm-icone-genre.garcon {
    background: linear-gradient(135deg, var(--bleu-tendre), var(--ciel));
}

.mlm-texte-genre {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--gris-lisible);
}

.mlm-emoji-genre {
    font-size: 2rem;
}

/* Menu déroulant ludique pour les thèmes */
.mlm-menu-deroulant-container {
    position: relative;
    margin-top: 10px;
    z-index: 9998;
}

.mlm-menu-deroulant-bouton {
    width: 100%;
    padding: 20px 25px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--gris-lisible);
    background: var(--gris-tres-doux);
    border: 3px solid var(--vert-doux);
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.mlm-menu-deroulant-bouton:hover {
    border-color: var(--vert-doux);
    background: var(--blanc-coton);
    transform: translateY(-2px);
    box-shadow: 0 0 0 4px rgba(181, 234, 215, 0.2);
}

.mlm-menu-deroulant-bouton.ouvert {
    border-color: var(--vert-doux);
    background: var(--blanc-coton);
    border-radius: 25px 25px 0 0;
}

.mlm-menu-deroulant-texte {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mlm-menu-deroulant-icone {
    font-size: 1.5rem;
    color: var(--vert-doux);
    transition: transform 0.3s ease;
}

.mlm-menu-deroulant-bouton.ouvert .mlm-menu-deroulant-icone {
    transform: rotate(180deg);
}

.mlm-menu-deroulant-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blanc-coton);
    border: 3px solid var(--vert-doux);
    border-top: none;
    border-radius: 0 0 25px 25px;
    box-shadow: var(--ombre-douce);
    max-height: 60vh; /* Utilise 60% de la hauteur de l'écran */
    min-height: 200px;
    overflow-y: auto;
    z-index: 9999 !important;
    display: none;
    /* Améliorer le défilement */
    scrollbar-width: thin;
    scrollbar-color: var(--vert-doux) var(--gris-tres-doux);
    /* Performance pour de nombreux éléments */
    will-change: scroll-position;
    contain: layout style paint;
}

/* Styles pour la barre de défilement WebKit */
.mlm-menu-deroulant-options::-webkit-scrollbar {
    width: 8px;
}

.mlm-menu-deroulant-options::-webkit-scrollbar-track {
    background: var(--gris-tres-doux);
    border-radius: 10px;
}

.mlm-menu-deroulant-options::-webkit-scrollbar-thumb {
    background: var(--vert-doux);
    border-radius: 10px;
}

.mlm-menu-deroulant-options::-webkit-scrollbar-thumb:hover {
    background: var(--bleu-tendre);
}

.mlm-menu-deroulant-options.ouvert {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.mlm-menu-option {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--gris-tres-doux);
}

.mlm-menu-option:last-child {
    border-bottom: none;
}

.mlm-menu-option:hover {
    background: linear-gradient(135deg, rgba(181, 234, 215, 0.3), rgba(167, 220, 224, 0.3));
}

.mlm-menu-option.selected {
    background: linear-gradient(135deg, var(--vert-doux), var(--bleu-tendre));
    color: white;
}

.mlm-menu-option-icone {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mlm-menu-option-texte {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
}

.mlm-menu-option-emoji {
    font-size: 1.5rem;
    margin-left: auto;
}

/* Options niveau avec étoiles */
.mlm-options-niveau {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.mlm-option-niveau {
    position: relative;
    cursor: pointer;
}

.mlm-input-niveau {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.mlm-carte-niveau {
    background: var(--gris-tres-doux);
    border: 3px solid transparent;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.mlm-input-niveau:checked + .mlm-carte-niveau {
    border-color: var(--jaune-soleil);
    background: linear-gradient(135deg, rgba(255, 218, 193, 0.3), rgba(255, 250, 205, 0.3));
    transform: translateY(-5px);
    box-shadow: var(--ombre-douce);
}

.mlm-icone-niveau {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.mlm-etoile-niveau {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--jaune-soleil), var(--orange-creme));
    box-shadow: var(--ombre-floue);
}

.mlm-texte-niveau {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--gris-lisible);
}

.mlm-description-niveau {
    font-size: 1rem;
    color: var(--gris-lisible);
    opacity: 0.8;
}

.mlm-emoji-niveau {
    font-size: 1.5rem;
}

/* Bouton submit */
.mlm-contenu-bouton {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px dashed var(--gris-tres-doux);
}

.mlm-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: white;
    background: linear-gradient(135deg, var(--corail), var(--saumon));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--ombre-douce);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.mlm-btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.mlm-btn-submit:active {
    transform: translateY(-1px);
}

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

.mlm-btn-submit:hover::before {
    left: 100%;
}

.mlm-icone-bouton {
    font-size: 1.8rem;
}

/* Conteneur du livre */
.mlm-livre-container {
    display: none;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Effet magique pour la couverture */
.mlm-magic-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: magicPulse 2s ease-in-out;
}

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

.mlm-sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--jaune-soleil);
    box-shadow: 0 0 10px 2px var(--jaune-soleil);
    animation: sparkleAnimation 1.5s ease-out forwards;
}

@keyframes sparkleAnimation {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1); opacity: 0; }
}

/* Couverture du livre */
.mlm-couverture-livre {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: calc(100vh - 160px); /* Utilise la hauteur d'écran moins l'espace pour les marges */
    min-height: 400px; /* Hauteur minimum */
    max-height: 700px; /* Hauteur maximum */
    margin: 0 auto 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--ombre-douce);
    transform-style: preserve-3d;
    transition: transform 1s ease;
}

.mlm-couverture-fond {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
}

.mlm-couverture-contenu {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.5));
}

.mlm-titre-couverture {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    line-height: 1.2;
    text-transform: uppercase;
}

.mlm-sous-titre-couverture {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--jaune-soleil);
    margin-bottom: 30px;
}

.mlm-niveau-indication-couverture {
    background: rgba(255, 255, 255, 0.9);
    color: var(--violet-reve);
    padding: 10px 25px;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: var(--ombre-floue);
}

.mlm-btn-commencer {
    margin-top: 40px;
    padding: 15px 40px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: white;
    background: linear-gradient(135deg, var(--corail), var(--saumon));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--ombre-floue);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.mlm-btn-commencer:hover {
    transform: translateY(-3px);
    box-shadow: var(--ombre-douce);
}

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

.mlm-btn-commencer:hover::before {
    left: 100%;
}

/* Livre horizontal */
.mlm-livre-horizontal {
    display: none;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--gris-tres-doux);
    border-radius: 20px;
    box-shadow: var(--ombre-douce);
    overflow: hidden;
}

.mlm-pages-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    height: calc(100vh - 200px); /* Utilise la hauteur d'écran moins l'espace pour la navigation */
    min-height: 400px; /* Hauteur minimum pour éviter un affichage trop petit */
    max-height: 800px; /* Hauteur maximum pour les très grands écrans */
}

.mlm-page-livre {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: var(--blanc-coton);
    border-right: 1px solid var(--gris-tres-doux);
}

.mlm-page-livre:last-child {
    border-right: none;
}

.mlm-page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.mlm-page-header {
    background: linear-gradient(90deg, var(--rose-bonbon), var(--orange-creme));
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mlm-page-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
}

.mlm-page-number {
    background: var(--blanc-coton);
    color: var(--violet-reve);
    padding: 5px 15px;
    border-radius: 20px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1rem;
}

.mlm-page-illustration {
    flex: 0 0 auto; /* Permet à l'illustration de s'adapter à sa taille naturelle */
    max-height: 45vh; /* Maximum 45% de la hauteur d'écran */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    overflow: hidden;
}

.mlm-illustration-img {
    max-width: 100%;
    max-height: 40vh; /* Maximum 40% de la hauteur d'écran */
    height: auto;
    width: auto;
    border-radius: 15px;
    box-shadow: var(--ombre-floue);
    object-fit: contain; /* Préserve les proportions de l'image */
}

.mlm-page-text {
    flex: 1;
    background: var(--blanc-coton);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--ombre-floue);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px; /* Hauteur minimum pour le texte */
}

.mlm-texte-page {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 4vw, 2.5rem); /* Taille responsive du texte */
    line-height: 1.4;
    color: var(--lettre-prononcee);
    text-transform: uppercase;
    word-wrap: break-word;
    hyphens: auto;
}

/* Coloration pédagogique */
.mlm-digramme {
    color: var(--digramme-vert);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.mlm-digramme::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: var(--digramme-vert);
    opacity: 0.3;
    border-radius: 3px;
    z-index: -1;
}

.mlm-muette {
    color: var(--lettre-muette);
    opacity: 0.7;
}

.mlm-prononcee {
    color: var(--lettre-prononcee);
}

/* Arc-en-ciel pour le prénom */
.mlm-arc-en-ciel {
    display: inline-block;
    position: relative;
    font-weight: 700 !important;
    color: transparent !important;
    background: linear-gradient(
        90deg,
        var(--arc-rouge) 0%,
        var(--arc-orange) 14%,
        var(--arc-jaune) 28%,
        var(--arc-vert) 42%,
        var(--arc-bleu) 57%,
        var(--arc-indigo) 71%,
        var(--arc-violet) 85%,
        var(--arc-rouge) 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: arc-en-ciel-animation 4s ease-in-out infinite;
    text-shadow: none;
    /* Forcer l'affichage de toutes les lettres */
    white-space: nowrap;
    overflow: visible;
    width: auto;
    min-width: fit-content;
}

@keyframes arc-en-ciel-animation {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Variante pour le titre de couverture */
.mlm-titre-couverture .mlm-arc-en-ciel {
    font-size: inherit;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Variante pour le texte des pages */
.mlm-texte-page .mlm-arc-en-ciel {
    font-size: inherit;
    position: relative;
}

/* Navigation */
.mlm-navigation-livre {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: var(--gris-tres-doux);
    border-top: 1px solid var(--bleu-tendre);
}

.mlm-nav-btn {
    background: linear-gradient(135deg, var(--vert-doux), var(--bleu-tendre));
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--ombre-floue);
    transition: all 0.3s ease;
}

.mlm-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--ombre-douce);
}

.mlm-nav-btn i {
    font-size: 1.5rem;
    color: white;
}

.mlm-nav-indicator {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mlm-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bleu-tendre);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mlm-nav-dot.active {
    background: var(--vert-doux);
    transform: scale(1.2);
}

/* Contrôles audio */
.mlm-controles-audio {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: linear-gradient(90deg, var(--violet-reve), var(--bleu-tendre));
}

.mlm-btn-audio {
    background: var(--blanc-coton);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--ombre-floue);
    transition: all 0.3s ease;
    position: relative;
}

.mlm-btn-audio:hover {
    transform: scale(1.1);
    box-shadow: var(--ombre-douce);
}

.mlm-btn-audio i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--rose-bonbon), var(--orange-creme));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mlm-btn-audio.playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--rose-bonbon);
    animation: pulse 1.5s infinite;
}

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

/* Options de téléchargement */
.mlm-options-telechargement {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: var(--gris-tres-doux);
    border-top: 1px solid var(--bleu-tendre);
}

.mlm-btn-telechargement {
    background: linear-gradient(135deg, var(--violet-reve), var(--lavande));
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--ombre-floue);
    transition: all 0.3s ease;
}

.mlm-btn-telechargement:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombre-douce);
}

.mlm-btn-telechargement i {
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .mlm-container {
        padding: 10px;
    }
    
    .mlm-formulaire-container {
        margin: 0;
        border-radius: 20px;
    }
    
    .mlm-contenu-formulaire {
        padding: 20px 15px;
    }
    
    .mlm-options-genre,
    .mlm-options-niveau {
        grid-template-columns: 1fr;
    }
    
    .mlm-livre-horizontal {
        border-radius: 10px;
    }
    
    .mlm-pages-container {
        height: 500px;
    }
    
    .mlm-page-content {
        padding: 15px;
    }
    
    .mlm-texte-page {
        font-size: 1.5rem;
    }
    
    .mlm-navigation-livre,
    .mlm-options-telechargement {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mlm-btn-telechargement {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .mlm-titre-formulaire {
        font-size: 1.8rem;
    }
    
    .mlm-sous-titre-formulaire {
        font-size: 1rem;
    }
    
    .mlm-texte-etape {
        font-size: 1.3rem;
    }
    
    .mlm-input-prenom {
        font-size: 1.3rem;
        padding: 15px 20px 15px 60px;
    }
    
    .mlm-btn-submit {
        font-size: 1.3rem;
        padding: 15px 30px;
    }
    
    .mlm-titre-couverture {
        font-size: 2rem;
    }
    
    .mlm-sous-titre-couverture {
        font-size: 1.2rem;
    }
    
    .mlm-texte-page {
        font-size: 1.2rem;
    }
}




/* Masquer les niveaux 2 et 3 */
.mlm-option-niveau[for*="niveau-2"],
.mlm-option-niveau[for*="niveau-3"] {
    display: none !important;
}

.mlm-options-niveau {
    grid-template-columns: 1fr !important;
    justify-content: center;
}

.mlm-option-niveau {
    max-width: 300px;
    margin: 0 auto;
}




/* Boutons de navigation pour enfants */
.mlm-boutons-navigation-enfant {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.mlm-btn-navigation-enfant {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 900;
    color: white !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    font-family: 'Fredoka', sans-serif;
    line-height: 1;
    text-align: center;
}

.mlm-btn-text {
    color: white !important;
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    font-family: Arial, sans-serif !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
    line-height: 1;
}

.mlm-btn-navigation-enfant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.3s ease;
    z-index: 1;
}

.mlm-btn-navigation-enfant:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.mlm-btn-navigation-enfant:hover::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.4), transparent);
}

.mlm-btn-navigation-enfant:active {
    transform: scale(0.95);
}

/* Bouton retour - couleur orange douce */
.mlm-btn-retour {
    background: linear-gradient(135deg, var(--orange-creme), #FF8C42);
}

.mlm-btn-retour:hover {
    background: linear-gradient(135deg, #FF8C42, var(--orange-creme));
}

/* Bouton recommencer - couleur verte douce */
.mlm-btn-recommencer {
    background: linear-gradient(135deg, var(--vert-doux), #4CAF50);
}

.mlm-btn-recommencer:hover {
    background: linear-gradient(135deg, #4CAF50, var(--vert-doux));
}

/* Animation de rebond pour attirer l'attention */
@keyframes rebond-enfant {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.mlm-btn-navigation-enfant.rebond {
    animation: rebond-enfant 2s infinite;
}

/* Responsive pour les boutons */
@media (max-width: 768px) {
    .mlm-boutons-navigation-enfant {
        top: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .mlm-btn-navigation-enfant {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .mlm-boutons-navigation-enfant {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: column;
    }
    
    .mlm-btn-navigation-enfant {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

/* Tooltip pour les boutons (aide pour les parents) */
.mlm-btn-navigation-enfant[data-tooltip] {
    position: relative;
}

.mlm-btn-navigation-enfant[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}


/* Protection des prénoms complets contre les règles pédagogiques */
.mlm-prenom-complet {
    /* Forcer l'affichage de toutes les lettres du prénom sans coloration pédagogique */
    color: transparent !important;
}

.mlm-prenom-complet * {
    /* Empêcher toute coloration des lettres à l'intérieur du prénom */
    color: transparent !important;
    background: inherit !important;
}



/* ===== MEDIA QUERIES POUR RESPONSIVE DESIGN ===== */

/* Très petits écrans - Smartphones en portrait (320px - 480px) */
@media (max-width: 480px) {
    .mlm-container {
        padding: 10px;
    }
    
    .mlm-pages-container {
        height: calc(100vh - 150px);
        min-height: 350px;
    }
    
    .mlm-page-content {
        padding: 10px;
    }
    
    .mlm-page-illustration {
        max-height: 35vh;
        margin-bottom: 15px;
    }
    
    .mlm-illustration-img {
        max-height: 30vh;
    }
    
    .mlm-page-text {
        padding: 15px;
        min-height: 100px;
    }
    
    .mlm-texte-page {
        font-size: clamp(1rem, 5vw, 1.8rem);
        line-height: 1.3;
    }
    
    .mlm-page-header {
        padding: 10px 15px;
        margin-bottom: 15px;
    }
    
    .mlm-page-title {
        font-size: 1.2rem;
    }
    
    .mlm-couverture-livre {
        height: calc(100vh - 100px);
        min-height: 400px;
    }
}

/* Petits écrans - Smartphones en paysage et petites tablettes (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .mlm-container {
        padding: 15px;
    }
    
    .mlm-pages-container {
        height: calc(100vh - 180px);
        min-height: 400px;
    }
    
    .mlm-page-content {
        padding: 15px;
    }
    
    .mlm-page-illustration {
        max-height: 40vh;
        margin-bottom: 18px;
    }
    
    .mlm-illustration-img {
        max-height: 35vh;
    }
    
    .mlm-page-text {
        padding: 20px;
        min-height: 110px;
    }
    
    .mlm-texte-page {
        font-size: clamp(1.1rem, 4.5vw, 2.2rem);
        line-height: 1.35;
    }
    
    .mlm-couverture-livre {
        height: calc(100vh - 120px);
        min-height: 450px;
    }
}

/* Tablettes en portrait (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .mlm-pages-container {
        height: calc(100vh - 200px);
        min-height: 500px;
    }
    
    .mlm-page-illustration {
        max-height: 42vh;
    }
    
    .mlm-illustration-img {
        max-height: 38vh;
    }
    
    .mlm-texte-page {
        font-size: clamp(1.3rem, 4vw, 2.3rem);
    }
    
    .mlm-couverture-livre {
        height: calc(100vh - 140px);
        min-height: 500px;
    }
}

/* Écrans moyens - Tablettes en paysage et petits desktops (1025px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
    .mlm-pages-container {
        height: calc(100vh - 220px);
        min-height: 550px;
        max-height: 700px;
    }
    
    .mlm-page-illustration {
        max-height: 45vh;
    }
    
    .mlm-illustration-img {
        max-height: 40vh;
    }
    
    .mlm-texte-page {
        font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    }
}

/* Grands écrans - Desktops (1367px et plus) */
@media (min-width: 1367px) {
    .mlm-pages-container {
        height: calc(100vh - 250px);
        min-height: 600px;
        max-height: 800px;
    }
    
    .mlm-page-illustration {
        max-height: 45vh;
    }
    
    .mlm-illustration-img {
        max-height: 40vh;
    }
    
    .mlm-texte-page {
        font-size: clamp(1.5rem, 3vw, 2.5rem);
    }
}

/* Écrans très hauts (orientation portrait sur desktop) */
@media (min-height: 900px) and (orientation: portrait) {
    .mlm-pages-container {
        height: calc(100vh - 300px);
        max-height: 900px;
    }
    
    .mlm-page-illustration {
        max-height: 50vh;
    }
    
    .mlm-illustration-img {
        max-height: 45vh;
    }
}

/* Écrans très larges (orientation paysage) */
@media (min-width: 1920px) and (orientation: landscape) {
    .mlm-pages-container {
        max-height: 700px;
    }
    
    .mlm-page-illustration {
        max-height: 40vh;
    }
    
    .mlm-illustration-img {
        max-height: 35vh;
    }
}

/* Corrections spécifiques pour les images plus petites */
.mlm-page-illustration.small-image {
    flex: 0 0 auto;
    max-height: 30vh;
}

.mlm-page-illustration.small-image .mlm-illustration-img {
    max-height: 25vh;
}

/* Amélioration pour les écrans tactiles */
@media (hover: none) and (pointer: coarse) {
    .mlm-page-text {
        padding: 20px;
    }
    
    .mlm-texte-page {
        font-size: clamp(1.1rem, 5vw, 2.2rem);
        line-height: 1.5;
    }
}

/* Mode paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .mlm-pages-container {
        height: calc(100vh - 100px);
        min-height: 300px;
    }
    
    .mlm-page-content {
        padding: 10px;
        flex-direction: row;
        align-items: center;
    }
    
    .mlm-page-illustration {
        flex: 0 0 40%;
        max-height: 60vh;
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .mlm-illustration-img {
        max-height: 55vh;
    }
    
    .mlm-page-text {
        flex: 1;
        margin-bottom: 0;
        min-height: auto;
    }
    
    .mlm-texte-page {
        font-size: clamp(0.9rem, 3vw, 1.5rem);
    }
    
    .mlm-page-header {
        margin-bottom: 10px;
    }
}

