:root {
    /* PALETTE DE COULEURS LA ROCHELLE */
    --blue-rochelle: #1c9cd9;   /* Bleu principal */
    --yellow-rochelle: #FFC425;  /* Jaune accentué */
    --grey-light: #f8f9fa;
    --grey-text: #333333;
    --grey-medium: #6c757d;
}

/* --- OPTIMISATION : Règle globale pour corriger les décalages --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

@keyframes breathe { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

body { 
    font-family: 'Montserrat', sans-serif; 
    margin: 0;
    color: var(--grey-text);
    background-color: var(--grey-light);
    background-image: 
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%231c9cd9' fill-opacity='0.08' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23FFC425' fill-opacity='0.08' fill-rule='evenodd'%3E%3Cpath d='M20 0L40 20V0M0 20L20 0H0'/%3E%3C/g%3E%3C/svg%3E");
}

.site-header { background-color: white; padding: 15px 30px; display: flex; align-items: center; border-bottom: 3px solid var(--yellow-rochelle); }
.site-header img { height: 50px; margin-right: 20px; }
.site-header h1 { color: #0d2c4a; font-size: 24px; margin: 0; font-weight: 700; }
#main-container { max-width: 750px; width: 90%; margin: 40px auto; text-align: center; background-color: rgba(255, 255, 255, 0.98); padding: 30px 40px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); backdrop-filter: blur(5px); }

#main-container h2 { font-size: 28px; color: var(--grey-text); font-weight: 700; margin-bottom: 10px; margin-top: 0; }
#main-container h3 { font-size: 24px; color: var(--grey-text); font-weight: 400; margin-bottom: 20px; margin-top: 0; }

.story-intro {
    text-align: center;
    margin-bottom: 25px;
    padding: 0 20px;
    font-size: 15px;
    color: var(--grey-medium);
    line-height: 1.6;
}

.video-container { 
    position: relative; 
    width: 100%; 
    max-width: 360px;
    aspect-ratio: 9 / 16;
    background: #e9ecef; 
    border: 1px solid #dee2e6; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    border-radius: 12px; 
    margin: 20px auto; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
}

.video-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s ease-in-out; }
.video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.4s ease-in-out; z-index: 2; background-color: black; }
.video-container .default-image { animation: breathe 6s ease-in-out infinite; z-index: 1; }

.loader-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.loader-logo { height: 60px; width: 60px; background-image: url('logo_la_rochelle.png'); background-size: contain; background-repeat: no-repeat; background-position: center; animation: spin 2s linear infinite; }

.video-container.is-loading .loader-container { opacity: 1; visibility: visible; }
.video-container.is-loading .default-image { opacity: 0.4; animation-play-state: paused; }
.video-container.video-is-active .default-image { opacity: 0; }

.text-input-container { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; }
.question-input { flex-grow: 1; border: 2px solid #ced4da; border-radius: 50px; padding: 12px 20px; font-size: 16px; font-family: 'Montserrat', sans-serif; }
.question-input:focus { outline: none; border-color: var(--blue-rochelle); }
.submit-question-btn { flex-shrink: 0; background-color: var(--blue-rochelle); color: white; border: none; border-radius: 50%; width: 50px; height: 50px; cursor: pointer; font-size: 20px; transition: background-color 0.3s; }
.submit-question-btn:hover { background-color: var(--yellow-rochelle); color: #0d2c4a; }
.separator { font-weight: 700; color: var(--grey-medium); margin-bottom: 20px; }
.questions-container { margin-top: 20px; }
.questions-panel { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.hidden { display: none !important; }

.question-btn { padding: 12px 25px; font-size: 16px; font-weight: 700; cursor: pointer; background: var(--blue-rochelle); color: white; border: 2px solid var(--blue-rochelle); border-radius: 50px; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.question-btn:hover { background: white; color: var(--blue-rochelle); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.question-btn.active { background: var(--yellow-rochelle); border-color: var(--yellow-rochelle); color: #0d2c4a; }
.question-btn:disabled, .question-btn:disabled:hover { background-color: #e9ecef; border-color: #ced4da; color: #adb5bd; cursor: not-allowed; transform: none; box-shadow: none; }

.site-footer { margin-top: 60px; padding: 20px; text-align: center; color: #6c757d; border-top: 1px solid #ddd; font-size: 14px; background-color: white; }

#welcome-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 1000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; }
#welcome-modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
#welcome-modal { background: white; padding: 30px 40px; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.2); text-align: center; max-width: 500px; width: 90%; transform: scale(0.95); transition: transform 0.3s ease-in-out; }
#welcome-modal-overlay.active #welcome-modal { transform: scale(1); }
#welcome-modal h2 { color: var(--grey-text); margin-top: 0; }
#welcome-modal p { color: var(--grey-medium); font-size: 16px; line-height: 1.6; margin-bottom: 10px; }
#close-modal-btn { padding: 12px 30px; font-size: 16px; font-weight: 700; cursor: pointer; background: var(--yellow-rochelle); color: #0d2c4a; border: 2px solid var(--yellow-rochelle); border-radius: 50px; transition: all 0.3s ease; }
#close-modal-btn:hover { transform: scale(1.05); }

/* --- AJOUT : STYLES POUR LA FLÈCHE DE DÉFILEMENT --- */
.scroll-down-arrow {
    margin-bottom: 20px;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

#next-video-popup { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); background-color: var(--blue-rochelle); color: white; padding: 25px 30px; border-radius: 16px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3); z-index: 1100; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.3s ease-in-out; width: 90%; max-width: 400px; text-align: center; }
#next-video-popup.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
#next-video-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }
#next-video-text { font-weight: 700; font-size: 18px; line-height: 1.4; }
#next-video-btn { background-color: var(--yellow-rochelle); color: #0d2c4a; border: none; border-radius: 30px; padding: 12px 25px; font-weight: 700; font-size: 16px; cursor: pointer; transition: transform 0.2s ease; }
#next-video-btn:hover { transform: scale(1.05); }
#close-next-popup-btn { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, 0.2); color: white; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 20px; line-height: 30px; padding: 0; transition: background-color 0.3s; }
#close-next-popup-btn:hover { background: rgba(255, 255, 255, 0.4); }

/* --- RÈGLES POUR LA RESPONSIVITÉ --- */

@media (max-width: 768px) {
    .site-header h1 { font-size: 20px; }
    #main-container { padding: 25px 30px; margin-top: 30px; margin-bottom: 30px; }
    #main-container h2 { font-size: 24px; }
    .question-btn { font-size: 15px; padding: 10px 20px; }
}

@media (max-width: 576px) {
    .site-header { flex-direction: column; text-align: center; padding: 15px; }
    .site-header img { margin-right: 0; margin-bottom: 10px; }
    #main-container { width: 95%; padding: 25px 15px; margin-top: 20px; margin-bottom: 20px; }
    #main-container h2 { font-size: 22px; }
    .questions-panel { gap: 10px; }
    .question-btn { width: 100%; padding: 14px; }
    .site-footer { margin-top: 40px; font-size: 12px; }
    #welcome-modal { padding: 25px 20px; }
    #welcome-modal p { font-size: 15px; }
    #next-video-text { font-size: 16px; }
}