/* view.css */

:root {
    --primary-color: #ff7900; /* Orange Orange */
    --bg-color: #f6f6f6;
    --text-color: #333;
    --card-bg: white;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --transition-speed: 0.5s; /* Vitesse de transition fluide */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    background-color: var(--bg-color);
    color: var(--text-color);
    /* Augmenter l'espace en haut pour compenser l'en-tête fixe (60px) */
    padding: 80px 20px 20px 20px; 
    margin: 0;
    transition: background-color var(--transition-speed);
}

/* -- STYLE DE L'EN-TÊTE FIXE -- */
.en-tete-principal {
    position: fixed; /* Reste toujours en haut lors du défilement */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Hauteur définie et fixe */
    box-sizing: border-box;
    background-color: #333;
    color: white;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    z-index: 1001; /* Le niveau le plus haut, au-dessus de la barre de récapitulatif */
}

.logo {
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: 900;
}

.titre-site {
    font-size: 1.1em;
    color: #ccc;
}

/* TITRE PRINCIPAL */
h1 {
    color: var(--primary-color);
    margin-bottom: 30px;
    opacity: 0;
    animation: slideInDown 0.6s ease-out forwards;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

/* ZONE DES QUESTIONS */
.conteneur-question {
    background: var(--card-bg);
    margin: 30px auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    box-shadow: var(--shadow);
    opacity: 0; /* Caché au départ */
    transform: translateY(20px); /* Légèrement décalé vers le bas */
    transition: all var(--transition-speed) ease;
}

/* Effet de disparition quand le mode final est activé */
body.mode-final .conteneur-question {
    opacity: 0;
    transform: translateY(-50px);
    pointer-events: none;
}

/* Quand l'étape est active et visible */
.conteneur-question.active {
    opacity: 1;
    transform: translateY(0);
}

/* BOUTONS ET CHOIX */
.groupe-boutons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.bouton-choix {
    padding: 12px 25px;
    border: 2px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1em;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bouton-choix:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(255,121,0,0.3);
}

.bouton-choix.choisi {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) inset;
}

/* Effet d'ondulation (Ripple) */
.bouton-choix .ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

/* DÉFINITION DES KEYFRAMES (Animations) */
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* CLASSES UTILITAIRES */
.masque {
    display: none;
}

.masque-complet {
    display: none !important;
}

/* SECTION 1 : STYLE DE LA BARRE DE RÉCAPITULATIF (Top Bar) */
.barre-recap {
    position: fixed;
    top: 60px; /* Se place exactement sous l'en-tête principal qui fait 60px */
    left: 0;
    width: 100%;
    box-sizing: border-box; 
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000; /* Juste en dessous de l'en-tête (1001) */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap; /* Permet le passage à la ligne sur petit écran */
    gap: 10px; 
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-speed) ease;
}

/* Quand le mode final est activé, la barre de récapitulatif apparaît */
body.mode-final .barre-recap {
    opacity: 1;
    transform: translateY(0);
    display: flex !important;
}

/* Masquer le titre principal au centre quand la barre apparaît */
body.mode-final h1 {
    display: none; 
}

/* Style pour le titre déplacé à droite dans la barre */
.titre-recap {
    margin-left: auto; /* Pousse ce texte complètement à droite */
    font-weight: bold;
    font-size: 1.1em;
    color: white;
}

.pillule-recap {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    margin-right: 10px;
    font-weight: bold;
    font-size: 0.9em;
}

.separateur-recap {
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
    margin-right: 10px;
}

/* STYLE DU BOUTON MODIFIER */
.bouton-modifier {
    background-color: white;
    color: var(--primary-color);
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bouton-modifier:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* SECTION 3 : STYLE DE LA NOUVELLE PAGE DE INSTRUCTIONS */
#pageInstructions {
    margin: 20px auto; /* Espace réduit pour un rendu plus équilibré */
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 12px;
    max-width: 800px;
    text-align: left;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-speed) ease;
}

/* Quand les instructions détaillées apparaissent */
#pageInstructions.active {
    opacity: 1;
    transform: translateY(0);
}

/* Ajuster l'espacement global en mode final (quand la barre est visible) */
body.mode-final {
    padding-top: 130px; /* 60px (Header) + Hauteur estimée de la barre Recap */
}

/* Retirer l'espace occupé par le wizard dans le mode final */
body.mode-final #zoneWizard {
    position: absolute; /* Sort l'élément du flux normal du document */
    visibility: hidden; /* Rend l'élément invisible */
    width: 100%;
    left: 0;
}

/* =========================================================
   RÉACTIVITÉ POUR LES PETITS ÉCRANS (Laptops 13" et Zoom)
   ========================================================= */

@media (max-width: 1024px) {
    /* Masquer le titre à droite sur petit écran pour gagner de la place */
    .titre-recap {
        display: none; 
    }

    /* Augmenter l'espace en haut car la barre-recap prendra au moins 2 lignes */
    body.mode-final {
        padding-top: 160px; 
    }

    /* Ajuster la barre pour les petits écrans */
    .barre-recap {
        padding: 15px;
        justify-content: center; /* Centrer pour un meilleur rendu visuel */
    }

    /* Masquer les séparateurs (flèches) pour éviter l'encombrement */
    .separateur-recap {
        display: none;
    }

    /* Le bouton modifier prendra sa place naturellement en dessous */
    .bouton-modifier {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* =========================================================
   STYLE DES BOOKMARKLETS (GLISSER-DÉPOSER)
   ========================================================= */
.conteneur-bookmarklet {
    background-color: #fff3e0;
    border: 1px dashed var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.bouton-bookmarklet {
    display: inline-block;
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    cursor: grab;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.bouton-bookmarklet:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.bouton-bookmarklet:active {
    cursor: grabbing;
}

.instruction-glisser {
    font-size: 0.85em;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* =========================================================
   STYLE DES ÉTAPES D'INSTRUCTION DÉTAILLÉES
   ========================================================= */
.bloc-instruction {
    background: white;
    border-left: 5px solid var(--primary-color);
    margin: 20px 0;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

/* L'étape devient visible */
.bloc-instruction.active {
    opacity: 1;
    transform: translateY(0);
}

/* État quand l'utilisateur a cliqué sur "Terminer" */
.bloc-instruction.terminee {
    border-left-color: #4caf50; /* Bordure verte pour le succès */
    background-color: #f0fdf4; /* Fond vert très clair */
    /* Plus d'opacité réduite ici pour garder le texte bien lisible */
}

/* Changer la couleur du titre en vert sans le barrer */
.bloc-instruction.terminee h3 {
    color: #4caf50;
    /* text-decoration: line-through; (Supprimé selon votre demande) */
}

/* Style du bouton de validation dans chaque étape */
.bouton-valider-etape {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.3s ease;
    
    /* NOUVEAUTÉ : Placer le bouton en bas à droite */
    display: block;
    margin-left: auto;
}

.bouton-valider-etape:hover {
    background-color: #e66d00; /* Orange plus foncé */
}

/* Style du bouton quand il est désactivé (étape terminée) */
.bouton-valider-etape:disabled {
    background-color: #4caf50;
    cursor: default;
    box-shadow: none;
}


/* =========================================================
   ANIMATION FLÈCHE GUIDAGE (Style Simple)
   ========================================================= */

/* Conteneur pour aligner à droite */
.lm-actions-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    gap: 12px;
    margin-top: 20px;
}

.lm-actions-wrapper .bouton-valider-etape {
    margin-left: 0;
    margin-top: 0;
}

/* Texte simple et discret */
.lm-next-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ff7900; /* Orange classique */
    font-size: 14px;
    font-weight: bold;
    font-style: italic; /* Style italique léger */
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s ease-out;
}

/* Apparition de l'indication */
.bloc-instruction.active .lm-next-hint {
    opacity: 1;
    transform: translateX(0);
}

/* Masquer quand l'étape est validée */
.bloc-instruction.terminee .lm-next-hint {
    display: none !important;
}

/* Animation discrète de la flèche */
.lm-hint-arrow {
    display: inline-block;
    animation: lm-jump-simple 1.2s infinite ease-in-out;
}

@keyframes lm-jump-simple {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}