/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-color: #1a1a1a;
    --content-bg: #252525;
    --text-color: #f0f0f0;
    --accent-color: #a83f39; /* Rouge historique */
    --menu-text: #000000;
    
    /* Couleurs Quiz */
    --timer-bg: #333;
    --correct: #2e7d32;
    --wrong: #c62828;
    --gold: #ffd700;
}

* { box-sizing: border-box; }

body {
    font-family: 'Georgia', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding-top: 80px; /* Espace pour le menu fixe */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Image de fond Desktop */
@media (min-width: 769px) {
    body {
        background-image: 
            linear-gradient(rgba(26, 26, 26, 0.85), rgba(26, 26, 26, 0.85)),
            url('images/background-desktop.jpg');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
    }
}

/* =========================================
   2. BARRE DE NAVIGATION (NAVBAR)
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 50px;
    background: linear-gradient(rgba(168, 63, 57, 0.9), rgba(168, 63, 57, 0.9)), url('images/texture-barbele.png');
    background-repeat: repeat-x;
    background-position: center left;
    background-size: auto 50%;
    background-color: var(--accent-color);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 1000;
}

.nav-logo {
    font-family: 'Arial', sans-serif;
    color: var(--menu-text);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.1rem;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links { display: flex; gap: 20px; }
.nav-links a {
    font-family: 'Arial', sans-serif;
    color: var(--menu-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 0.7; text-decoration: underline; }
.nav-links a.active { border-bottom: 2px solid var(--menu-text); }

/* =========================================
   3. CONTENEURS (CORRIGÉS)
   ========================================= */
/* Style de base pour la boîte grise */
.main-container, .shop-container, .lecture-container, .faq-container, .home-container {
    background-color: var(--content-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 90%;
    margin-bottom: 40px;
    border-top: 1px solid #444;
    z-index: 10;
    position: relative;
    margin-left: auto; margin-right: auto;
}

/* 1. Accueil : Large et Vertical (Block) */
.home-container {
    max-width: 1200px;
    display: block; /* Force l'empilement vertical */
}

/* 2. Boutique : Large et Flexible (Côte à côte) */
.shop-container {
    max-width: 1200px;
    display: flex; 
    gap: 40px;
}

/* 3. Quiz et Textes : Etroit */
.main-container { max-width: 1200px; text-align: center; } 
.faq-container { max-width: 1200px; }
.lecture-container { max-width: 1200px; padding: 0; overflow: hidden; }

h1, h2, h3 { margin-bottom: 20px; font-weight: normal; }
h1 { font-size: 2em; text-transform: uppercase; color: var(--accent-color); margin-top: 0; }

/* Boutons */
.action-btn, .submit-btn, .btn {
    background-color: var(--accent-color);
    border: none; color: white; cursor: pointer; border-radius: 4px;
    font-family: 'Arial', sans-serif; transition: all 0.2s;
    text-decoration: none; display: inline-block;
}
.action-btn, .submit-btn { padding: 15px 40px; font-weight: bold; text-transform: uppercase; margin-top: 20px; font-size: 14px; width: 100%; text-align: center; }
.action-btn:hover, .submit-btn:hover { background-color: #c04e47; transform: scale(1.02); }

.btn { background-color: #333; border: 1px solid #555; padding: 15px 30px; }
.btn:hover { background-color: #444; }

/* Formulaires */
input, select, textarea {
    width: 100%; padding: 12px; font-size: 16px; border-radius: 4px;
    border: 1px solid #444; background: #333; color: white;
    font-family: 'Arial', sans-serif; margin-bottom: 10px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent-color); background-color: #3a3a3a; }
.hide, .hidden { display: none !important; }

/* =========================================
   4. SPÉCIFIQUE : ACCUEIL
   ========================================= */
.home-top-grid {
    display: flex; 
    flex-direction: row; /* Desktop : Cote à cote */
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

.hero-section { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; width: 100%; }
.hero-text { flex: 1; text-align: left; }
.hero-image { flex: 1; display: flex; justify-content: center; }

/* Livre 3D */
.book-3d {
    width: 300px;
    box-shadow: 20px 20px 50px rgba(0,0,0,0.7);
    border-radius: 4px;
    transition: transform 0.3s;
    animation: float 6s ease-in-out infinite;
}
.book-3d:hover { transform: perspective(1000px) rotateY(0deg) scale(1.05); }

@keyframes float {
    0% { transform: perspective(1000px) rotateY(-15deg) translateY(0px); }
    50% { transform: perspective(1000px) rotateY(-15deg) translateY(-15px); }
    100% { transform: perspective(1000px) rotateY(-15deg) translateY(0px); }
}

/* Machine à écrire */
.typewriter h1 {
    color: var(--accent-color); overflow: hidden; border-right: .15em solid var(--accent-color);
    white-space: nowrap; margin: 0 auto 20px 0; letter-spacing: 0.10em;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--accent-color) } }

/* Section Avis */
.reviews-section { margin-top: 0; width: 350px; flex-shrink: 1; }
.reviews-title { color: var(--accent-color); text-transform: uppercase; font-size: 1.2em; border-bottom: 1px solid var(--accent-color); padding-bottom: 10px; margin-bottom: 20px; }
.reviews-container { display: flex; flex-direction: column; gap: 15px; }
.review-card { background: #2a2a2a; padding: 15px; border-radius: 4px; border-left: 3px solid #444; text-align: left; }
.stars { color: var(--gold); margin-bottom: 5px; }
.review-text { font-style: italic; color: #ccc; font-size: 0.9em; }
.review-author { text-align: right; font-size: 0.8em; font-weight: bold; color: #888; }


/* Bulles (Features) */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; padding-top: 30px; border-top: 1px solid #333; }
.feature-card {
    background: #2a2a2a; padding: 20px; border: 1px solid #333; border-radius: 4px;
    text-decoration: none; display: block; transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent-color); }
.feature-icon { font-size: 2em; display: block; margin-bottom: 10px; }
.feature-title { font-weight: bold; text-transform: uppercase; color: var(--accent-color); display: block; margin-bottom: 5px; }
.feature-card p { color: #cccccc; font-size: 0.9em; margin: 0; }

/* =========================================
   5. SPÉCIFIQUE : QUIZ
   ========================================= */
.timer-container { width: 100%; height: 8px; background-color: var(--timer-bg); position: absolute; top: 0; left: 0; }
.timer-bar { height: 100%; background-color: #fff; width: 100%; transition: width 1s linear; }
.info-bar { display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 14px; color: #888; font-family: sans-serif; }
.btn-grid { display: grid; gap: 15px; margin-top: 25px; }
.btn-quiz { background-color: #333; border: 1px solid #444; padding: 15px; font-size: 16px; text-align: left; color: white; width: 100%; cursor: pointer; }
.btn-quiz:hover { background-color: #444; }
.btn-quiz.correct { background-color: var(--correct) !important; border-color: var(--correct); }
.btn-quiz.wrong { background-color: var(--wrong) !important; border-color: var(--wrong); }
.question-box { background: #222; padding: 20px; margin-bottom: 20px; border-radius: 8px; }

/* Classements */
.leaderboard-list { list-style: none; padding: 0; margin-top: 20px; text-align: left; max-height: 300px; overflow-y: auto; border: 1px solid #333; border-radius: 4px; }
.leaderboard-list li { background: #2a2a2a; margin-bottom: 2px; padding: 12px; display: flex; justify-content: space-between; font-size: 14px; font-family: 'Arial', sans-serif; }
.leaderboard-list li:nth-child(odd) { background-color: #303030; }
.leaderboard-list li:nth-child(1) { border-left: 4px solid var(--gold); background-color: #383830; }
.leaderboard-list li:nth-child(2) { border-left: 4px solid #c0c0c0; } 
.leaderboard-list li:nth-child(3) { border-left: 4px solid #cd7f32; } 
#mini-list {list-style-type:none;}

/* Quand la réponse est correcte (Vert) */
.btn.correct {
    background-color: #2e7d32 !important; /* Vert foncé */
    border-color: #4caf50 !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5); /* Petit effet lumineux */
}

/* Quand la réponse est fausse (Rouge) */
.btn.wrong {
    background-color: #c62828 !important; /* Rouge foncé */
    border-color: #ef5350 !important;
    color: white !important;
    opacity: 0.8;
}

/* =========================================
   6. SPÉCIFIQUE : BOUTIQUE & CONTACT
   ========================================= */
.product-col { text-align: center; border-right: 1px solid #444; padding-right: 40px; flex: 1; }
.form-col { flex: 1.5; }
.book-cover { width: 100%; max-width: 300px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); border-radius: 4px; margin-bottom: 20px; }
.price-tag { font-size: 2em; color: var(--accent-color); font-weight: bold; margin: 20px 0; }

.radio-group { display: flex; gap: 20px; margin-bottom: 20px; background: #333; padding: 15px; border-radius: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.promo-section { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #444; }
.promo-section input { font-weight: bold; letter-spacing: 1px; }
.mode-selector input {width:auto;}

/* =========================================
   7. PAGES SPÉCIALES
   ========================================= */
/* Lecture */
.lecture-container { display: grid; grid-template-columns: 1fr 1fr; }
.lecture-infos { padding: 40px; display: flex; flex-direction: column; }
.lecture-visual { position: relative; cursor: pointer; overflow: hidden; height: 100%; min-height: 500px; }
.lecture-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; opacity: 0.8; }
.lecture-visual:hover img { transform: scale(1.05); opacity: 1; }
.lecture-actions { display: flex; gap: 10px; margin-top: 20px; }
.price-box { background: rgba(0,0,0,0.2); padding: 10px; margin-bottom: 20px; border-radius: 4px; display: flex; justify-content: space-between; }
.stamp { border: 2px solid var(--accent-color); color: var(--accent-color); padding: 5px; transform: rotate(-5deg); display: inline-block; margin-bottom: 15px; font-weight: bold; }
/* =========================================
   STYLE DE L'OVERLAY (La Loupe au survol)
   ========================================= */

/* Le calque noir par-dessus l'image (caché par défaut) */
.visual-overlay {position: absolute;top: 0; left: 0;width: 100%; height: 100%;background: rgba(0,0,0,0.4); /* Fond noir semi-transparent */display: flex;flex-direction: column;justify-content: center;align-items: center;opacity: 0; /* <--- IL EST INVISIBLE ICI */transition: all 0.3s ease;color: white;    font-weight: bold;backdrop-filter: blur(2px); /* Petit effet de flou sympa */}

/* C'EST CETTE LIGNE QUI FAIT APPARAÎTRE LA LOUPE ! */
/* "Quand je survole .lecture-visual, je mets l'opacité de .visual-overlay à 1" */
.lecture-visual:hover .visual-overlay {opacity: 1;}

/* Petit effet de zoom sur la loupe elle-même au survol */
.lecture-visual:hover .visual-overlay span:first-child {transform: scale(1.1);transition: transform 0.3s;}

/* Secret */
.secret-interface { border: 2px solid #333; padding: 20px; max-width: 800px; margin: 0 auto; position: relative; background: #111; }
.sound-toggle { position: relative; right: 0px; color: #666; cursor: pointer; border: 1px solid #444; padding: 5px; }
.sound-toggle.active { color: #0f0; border-color: #0f0; }
.code-display { font-family: 'Courier New', monospace; color: var(--accent-color); border-bottom: 1px dashed #555; padding-bottom: 20px; margin-bottom: 20px; font-size: 1.2em; }
.decoder-area { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* FAQ */
.faq-item { background: #222; border: 1px solid #333; margin-bottom: 10px; border-radius: 4px; overflow: hidden; }
.faq-item summary { padding: 15px; cursor: pointer; font-weight: bold; color: white; list-style: none; position: relative; }
.faq-item[open] summary { border-bottom: 1px solid #444; background: #2a2a2a; }
.faq-content { padding: 15px; background: #1a1a1a; color: #ccc; }

/* Modal & Cookies */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 9999; display: none; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-content { width: 95%; height: 95%; background: #222; position: relative; }
.close-btn { position: absolute; top: -30px; right: 0; color: white; font-size: 1.5em; background: none; border: none; cursor: pointer; }

.cookie-banner { position: fixed; bottom: -100%; left: 0; width: 100%; background: #111; border-top: 3px solid var(--accent-color); padding: 20px; z-index: 99999; display: flex; justify-content: center; gap: 20px; transition: bottom 0.5s; }
.cookie-banner.visible { bottom: 0; }
.btn-cookie-primary { background: var(--accent-color); color: white; padding: 10px 20px; border: none; cursor: pointer; font-weight: bold; }

/* Footer */
.site-footer { background: var(--accent-color); padding: 0px; color: var(--menu-text); text-align: center; margin-top: auto; font-family: 'Arial', sans-serif; font-size: 0.8rem; width:100%;}
.footer-links a { margin: 0 10px; font-weight: bold; text-transform: uppercase; }

/* =========================================
   8. MOBILE / RESPONSIVE (CORRIGÉ)
   ========================================= */
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--menu-text); transition: 0.3s; }

@media (max-width: 900px) {
    /* Menu Hamburger */
    .hamburger { display: block; z-index: 2000; }
    .hamburger.open .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.open .bar:nth-child(2) { opacity: 0; }
    .hamburger.open .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-links {
        position: fixed; top: 0; right: -100%; height: 100vh; width: 70%;
        background-color: var(--accent-color);
        flex-direction: column; justify-content: center; align-items: center;
        transition: 0.4s ease; z-index: 1500; padding-top: 60px;
    }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 1.2rem; margin: 15px 0; border-bottom: 1px solid rgba(0,0,0,0.2); width: 80%; text-align: center; padding-bottom: 10px; }

    /* ACCUEIL MOBILE */
    .home-container { padding: 15px; } /* Moins de padding sur mobile */
    .home-top-grid { display: flex; flex-direction: column; }
    
    /* 1. Livre */
    .hero-section { flex-direction: column-reverse; margin-bottom: 20px; text-align: center; width: 100%; }
    .hero-image { width: 100%; justify-content: center; margin-bottom: 20px; }
    .book-3d { width: 80% !important; max-width: 350px; transform: none !important; animation: none; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
    .typewriter h1 { white-space: normal; border-right: none; animation: none; text-align: center; font-size: 1.8em; }

    /* 2. Avis */
    .reviews-section { width: 100%; margin-bottom: 20px; }

    /* 3. Bulles */
    .features-grid { grid-template-columns: 1fr 1fr; }

    /* Shop */
    .shop-container { flex-direction: column; }
    .product-col { border-right: none; border-bottom: 1px solid #444; padding-bottom: 30px; padding-right: 0; }
    
    /* Autres */
    .lecture-container { grid-template-columns: 1fr; }
    .lecture-visual { height: 250px; order: -1; }
    .row-2 { grid-template-columns: 1fr; }
    .cookie-banner { flex-direction: column; }
    .decoder-area { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
    .features-grid { grid-template-columns: 1fr; }
}