/* --- Variables et Style Global --- */
:root {
    --primary-color: #516c33; /* Vert forêt profond */
    --secondary-color: #f4f1de; /* Crème clair */
    --text-color: #3d405b;
    --success-bg: #e8f5e9;
    --success-text: #388e3c;
    --error-bg: #ffebee;
    --error-text: #d32f2f;
    --alert-bg: #fffbe6;
    --alert-border: #ffe58f;
    --alert-text: #faad14;
    --accent-color: #e07a5f; /* Corail doux */
}

body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    overflow-x: hidden; /* Empêche les barres de défilement horizontales accidentelles */
}

/* --- Navigation Principale --- */
.main-nav {
    background-color: #1b4332;
    padding: 10px 20px;
    text-align: center;
}
.nav-link {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.nav-link.active {
    background-color: var(--primary-color);
    font-weight: bold;
}
.nav-link:not(.active):hover {
    background-color: #99c16d;
}
/* Modal overlay */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center; /* horizontal centering */
    align-items: center;     /* vertical centering */
        align-content: center;
    z-index: 1000;
}


#final-score-screen {
    text-align: center;       /* center all text inside */
    display: flex;            /* use flex for vertical layout */
    flex-direction: column;   /* stack elements vertically */
    align-items: center;      /* center horizontally */
    justify-content: center;  /* center vertically if needed */
    padding: 20px;
}

#final-score-screen h2,
#final-score-screen p {
    margin: 10px 0;           /* add spacing */
}

#final-score-screen .share-buttons {
    display: flex;
    gap: 15px;                /* space between buttons */
    margin-top: 15px;
}

#final-score-screen button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}


y
/* Modal content */
.share-modal-content {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;

    /* ensure centering inside flex */
    margin: 0 auto;
}

.share-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.share-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.share-btn {
    padding: 10px 15px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
}
.share-btn:hover {
    background: #0056b3;
}

/* --- En-têtes (Header) --- */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 25px 30px;
    text-align: center;
    position: relative;
    height: 6em;
}



header h1 {
    margin: 0;
    font-size: 2.2em;
}
.scientific-name {
    font-style: italic;
    opacity: 0.8;
    margin-top: 5px;
}

/* --- Grille Principale (index.html) --- */
.search-container {
    margin-top: 15px;
}
.progress-container {
    width: 100%;
    max-width: 600px;
    height: 10px;
    background: #e5e5e5;
    border-radius: 6px;
    margin: 10px auto 20px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    transition: width 0.4s ease;
}

#searchInput {
    width: 80%;
    max-width: 400px;
    padding: 10px;
    border: none;
    border-radius: .5em;
    font-size: 1em;
}
#mushroom-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}
.mushroom-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mushroom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.mushroom-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}
.mushroom-card h2 {
    font-size: 1em;
    margin: 10px;
    color: #333;
}

/* --- Page de Détail & Fiche Réponse Quiz (Composants communs) --- */
.page-wrapper, .quiz-container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px 27vh;
}
.details-container {
    padding-top: 20px;
}
.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.back-link {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center; /* Valeur corrigée */
    gap: 8px;
    background-color: white;
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 5px; /* Marge réduite */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
    width: fit-content;
}
.back-link:hover {
    background-color: #e9e9e9;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}
.back-link svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
}
.info-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.alert-section {
    background-color: var(--alert-bg);
    border-left: 5px solid var(--alert-text);
    padding: 15px;
    border-radius: 4px;
}
.alert-section h3 { margin-top: 0; color: var(--alert-text); }
.alert-section p { margin-bottom: 0; }
.info-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.info-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.info-section h2 svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
}

/* --- Carrousel Photos (Style unifié) --- */
.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    aspect-ratio: 4 / 3;
    background-color: #e0e0e0;
}
.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}
.carousel-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 10;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    z-index: 10;
}

/* --- Page Quiz (Éléments spécifiques) --- */

.score-display {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px;
    min-height: 1.5em;
    display: none; 
}
.difficulty-selector {
    text-align: center;
    padding: 40px 0;
}
.difficulty-selector h2 {
    margin-bottom: 30px;
}
.difficulty-btn {
    display: block;
    width: 80%;
    max-width: 400px;
    margin: 15px auto;
    padding: 20px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}
.difficulty-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}
.difficulty-desc {
    display: block;
    font-size: 0.7em;
    font-weight: normal;
    margin-top: 5px;
    opacity: 0.8;
}
#quiz-section .carousel-container {
    aspect-ratio: 16 / 9;
    max-height: 45vh;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-top:1vh;
}
.footer-event-image{    border-radius: .5em;}
.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
}
@media (min-width: 768px) {
    .quiz-options {
        grid-template-columns: 1fr 1fr;
    }
}
.option-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color);
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.option-btn:not(:disabled):hover {
    background-color: var(--primary-color);
    color: white;
}
.option-btn.correct {
    background-color: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-text);
}
.option-btn.incorrect {
    background-color: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-text);
}
.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}
.quiz-form {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}
#quiz-input {
    flex-grow: 1;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ccc;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#quiz-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(45, 106, 79, 0.5);
}
#submit-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#submit-btn:disabled, #quiz-input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
#answer-details-container {
    padding-top: 20px;
}
.feedback-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}
.feedback-box.correct {
    background-color: var(--success-bg);
    color: var(--success-text);
}
.feedback-box.incorrect {
    background-color: var(--error-bg);
    color: var(--error-text);
}
.feedback-box h3, .feedback-box p {
    margin: 0 0 5px 0;
}
.next-question-btn {
    display: block;
    width: fit-content;
    margin: 30px auto 0 auto;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    background-color: var(--accent-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.next-question-btn:hover {
    background-color: #d8684a;
}
/* --- FOOTER STYLES --- */
.site-footer {
    color: #2a2a2a;
    position: relative;
}

/* Image sitting on top border */
.footer-border-image img {
    display: block;
width: 46%;    height: auto;
     margin-left: auto;
         margin-bottom: -3px;

}
@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-copy {
        text-align: center;
    }
    .footer-border-image img{width: 100%; }
}
.footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;      /* horizontal centering */
    justify-content: center;  /* vertical centering */
    text-align: center;       /* center text */
    gap: 0.5rem;
}

/* Footer layout */
.footer-inner {
    background: #f1f1f2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
    align-items: center;
    border-top: 2.5px solid #86858170;
}

/* CTA column */
.footer-cta h3 {
    margin: 0 0 0.5rem;
}

.footer-cta p {
    margin: 0 0 1rem;
    opacity: 0.9;
}

.footer-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #4caf50;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
}
.footer-container{background-color: #f1f1f2;}
.footer-btn:hover {
    background: #43a047;
}

/* Copyright column */
.footer-copy {
    text-align: right;
    font-size: 0.9rem;
    opacity: 0.8;
}
/* ----------------------------
   Share Modal Overlay
---------------------------- */
.share-modal {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 1000; /* above everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* scroll if needed */
    background-color: rgba(0, 0, 0, 0.6); /* semi-transparent background */
    backdrop-filter: blur(2px); /* subtle blur */
    animation: fadeIn 0.3s ease;
}

/* ----------------------------
   Modal Content Box
---------------------------- */
.share-modal-content {
    background-color: #fff;
    margin: 10% auto; /* center vertically & horizontally */
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: slideIn 0.3s ease;
}

/* ----------------------------
   Close Button (×)
---------------------------- */
.close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-btn:hover {
    color: #000;
}

/* ----------------------------
   Modal Heading & Text
---------------------------- */
.share-modal-content h2 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #333;
}
.share-modal-content p {
    margin: 1rem 0 1.5rem 0;
    color: #555;
    font-size: 1rem;
}

/* ----------------------------
   Share Buttons Container
---------------------------- */
.share-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

/* ----------------------------
   Individual Share Button
---------------------------- */
.share-btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    background-color: #0077b5; /* default color, override per platform */
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.share-btn:hover {
    transform: scale(1.05);
}

/* Colors for each platform */
#fb-share { background-color: #1877f2; }
#twitter-share { background-color: #1da1f2; }
#tiktok-share { background-color: #000; color: #fff; }

/* ----------------------------
   Animations
---------------------------- */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}
@keyframes slideIn {
    from {transform: translateY(-20px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

/* ----------------------------
   Responsive tweaks
---------------------------- */
@media (max-width: 480px) {
    .share-modal-content {
        margin: 20% auto;
        padding: 1.5rem;
    }
    .share-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .share-btn {
        width: 100%;
    }
}
