/* ============================================================
   Styles spécifiques à la page index des coloriages
   (les styles globaux sont dans style_coloriage.css)
   ============================================================ */

/* Bannière */
.banniere {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banniere h1 {
    color: #23043e;
    font-size: 2em;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Icône thème dans la bannière (C_ColoriagesUtil) */
.banniere .theme-icon {
    width: 50px;
    height: 50px;
    margin: 0 20px;
    display: block;
}

.avatar-banniere {
    width: 150px;
    height: auto;
    margin-right: 20px;
    vertical-align: middle;
    box-shadow: 0 0 0 10px white;
    border-radius: 5px;
}

.avatar-interactif {
    width: 120px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s;
    display: block;
    margin: 20px auto;
    box-shadow: 0 0 0 10px white;
    border-radius: 5px;
}

.avatar-interactif:hover {
    transform: scale(1.05);
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wave {
    0%   { transform: rotate(0deg); }
    20%  { transform: rotate(10deg); }
    40%  { transform: rotate(0deg); }
    60%  { transform: rotate(-10deg); }
    80%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.avatar-interactif.anim {
    animation: wave 2s infinite;
}

/* Section coloriages */
.section-formulaires {
    text-align: center;
    padding: 20px 0;
}

.section-formulaires h2 {
    color: #23043e;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.intro {
    max-width: 800px;
    margin: 0 auto 30px;
    color: #546e7a;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Grille des thèmes — surcharge locale de la grille globale */
.grille-formulaires {
    gap: 30px;
    margin: 30px auto;
    max-width: 1200px;
    justify-content: center;
}

/* Carte thème — enrichissement local */
.carte-formulaire {
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carte-formulaire:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.carte-icone {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.carte-icone img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carte-formulaire h3 {
    color: #23043e;
    margin: 10px 0;
    font-size: 1.3em;
}

.carte-formulaire p {
    color: #546e7a;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

.boutons {
    margin-top: 15px;
}

/* Bouton découvrir — surcharge locale */
.bouton-remplir {
    display: inline-block;
    padding: 10px 25px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.bouton-remplir:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Miniatures preview */
.miniatures-preview {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    height: 50px;
    overflow: hidden;
}

.miniatures-preview img {
    height: 100%;
    width: auto;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.miniatures-preview img:hover {
    opacity: 1;
}

/* Section Packs économie */
.section-packs {
    background-color: #f9f9f9;
    padding: 40px 20px;
    text-align: center;
    margin: 40px 0;
    border-radius: 12px;
}

.section-packs h2 {
    color: #23043e;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.section-packs p {
    color: #546e7a;
    font-size: 1.1em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.grille-packs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px auto;
    max-width: 1200px;
}

.carte-pack {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.carte-pack:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.carte-pack-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
}

.carte-pack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.carte-pack:hover .carte-pack-image img {
    transform: scale(1.05);
}

.carte-pack h3 {
    color: #23043e;
    font-size: 1.4em;
    margin-bottom: 10px;
}

.carte-pack p {
    color: #546e7a;
    font-size: 0.95em;
    margin-bottom: 15px;
    line-height: 1.5;
}

.carte-pack .prix {
    font-weight: bold;
    color: #4CAF50;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.bouton-decouvrir-packs {
    display: inline-block;
    padding: 12px 30px;
    background-color: #8ba4f0;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 30px;
}

.bouton-decouvrir-packs:hover {
    background-color: #7a95d5;
    transform: scale(1.05);
}

            
            .banniere h1 {
                margin: 0;
                font-size: 2em;
                position: relative;
                z-index: 1;
            }

            .banniere .theme-icon {
                width: 50px;
                height: 50px;
                margin: 0 20px;
                display: block;
            }

            /* Boutons d'action : format identique, seule la couleur change */
            .bouton-telecharger,
            .bouton-paiement.credits {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 80%;
                margin: 10px auto;
                padding: 10px 15px;
                box-sizing: border-box;
                border-radius: 6px;
                font-size: 0.7em;
                font-weight: bold;
                color: white;
                text-decoration: none;
                text-align: center;
            }

            .bouton-telecharger {
                background-color: #28a745;
            }

            .bouton-telecharger:hover {
                background-color: #218838;
            }

            .preview-modal {
                display: none;
                position: fixed;
                z-index: 1000;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                background-color: rgba(0, 0, 0, 0.9);
                overflow-y: auto;
            }

            .preview-modal.active {
                display: block;
            }

            .preview-modal-content {
                background-color: #fefefe;
                margin: 5% auto;
                padding: 20px;
                border-radius: 5px;
                width: 80%;
                max-width: 800px;
                max-height: 80vh;
                overflow-y: auto;
            }

            .preview-close {
                color: #aaa;
                float: right;
                font-size: 28px;
                font-weight: bold;
                cursor: pointer;
            }

            .preview-close:hover {
                color: black;
            }

            .preview-gallery {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
                gap: 10px;
                margin-top: 20px;
            }

            .preview-gallery img {
                width: 100%;
                height: auto;
                border-radius: 5px;
                cursor: pointer;
                transition: transform 0.3s;
            }

            .preview-gallery img:hover {
                transform: scale(1.05);
            }

            .credits-insuffisants {
                font-size: 0.8em;
                color: #e74c3c;
                font-weight: normal;
                margin-left: 5px;
            }

            .bouton-paiement.credits {
                background-color: #ff9800;
            }

            .bouton-paiement.credits:hover {
                background-color: #e68a00;
            }

            .titre {
                display: block;
                font-size: 0.9em;
                font-weight: bold;
                margin-bottom: 5px;
                text-align: center;
                color: #333;
            }

            .filtres-container {
                display: flex;
                justify-content: center;
                flex-wrap: wrap;
                gap: 20px;
                margin: 20px auto;
                max-width: 900px;
            }

            .form-row {
                display: flex;
                justify-content: center;
                flex-wrap: wrap;
                gap: 20px;
                width: 100%;
            }

            .form-group {
                display: flex;
                flex-direction: column;
                min-width: 200px;
            }

            .form-group label {
                margin-bottom: 5px;
                font-weight: bold;
                color: #1e3d33;
            }

            .form-group select {
                padding: 8px;
                border-radius: 4px;
                border: 1px solid #ccc;
                background-color: white;
            }

            /* Conteneur pour les pastilles (difficulté + classe) */
            .pastilles-container {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 10px;
                margin-top: 5px;
            }

            /* Pastille de difficulté */
            .difficulte {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                padding: 5px 10px;
                border-radius: 12px;
                font-size: 0.7em;
                font-weight: bold;
                color: white;
                line-height: 1;
            }

            /* Pastille de classe */
            .classe-badge {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                gap: 4px;
                padding: 5px 10px;
                border-radius: 12px;
                font-size: 0.7em;
                font-weight: bold;
                color: white;
                line-height: 1;
            }

            .classe-badge.simple {
                background-color: #95928d;
            }

            .classe-badge.complet {
                background-color: #21f3b1;
            }

            .difficulte.facile {
                background-color: #8BC34A;
            }

            .difficulte.moyen {
                background-color: #FFC107;
            }

            .difficulte.difficile {
                background-color: #F44336;
            }

            /* Conteneur relatif pour la carte */
            .coloriage-card {
                position: relative;
                display: inline-block;
                margin: 10px;
                text-align: center;
            }

/* =========================================================================
   À coller dans style_coloriage_index_livres.css
   (remplace la version précédente de ce snippet)
   ========================================================================= */

/* --- Vignette de couverture (1re page du PDF, rendue par PDF.js) --- */
/* Taille réduite + centrée, comme sur la page d'administration.        */
.coloriage-img.vignette-pdf {
    max-width: 130px;     /* réduit la vignette ; ajustable (110–160px) */
    margin: 0 auto;
    height: auto;
    overflow: hidden;
    line-height: 0;
    cursor: pointer;
}

.vignette-pdf-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #ffffff;
}

/* --- Modale d'aperçu : pages du livre rendues par PDF.js --- */
.preview-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.preview-page {
    width: 180px;
    height: auto;
    display: block;
    cursor: pointer;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.preview-erreur {
    color: #ffffff;
    text-align: center;
    width: 100%;
}

/* --- Coût en crédits détaché du bouton --- */
.cout-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    margin: 12px auto 10px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: bold;
    color: #23043e;
    background-color: #f3eefa;
}

.cout-credits i {
    color: #ff9800;
}

/* Variante : crédits insuffisants (couleur seulement) */
.cout-credits.cout-insuffisant {
    color: #c0392b;
    background-color: #fdecea;
}

.cout-credits.cout-insuffisant i {
    color: #e74c3c;
}