/* Variables CSS Globales */
:root {
    --primary-color: #DDE2C6; 
    --secondary-color: #9DB4A5;
    --accent-color: #D87C6F;
    --text-dark: #3A3842;
    --text-light: #F1FAEE;
    --bg-light: #F9F7F3;
    --bg-dark: #373F51;
    --envelope-base: #BAC2BA;
    --envelope-light-highlight: #ffffff;
    --envelope-dark-shadow: black;
    --envelope-inside: #e9e7da;
    --crease-line: #000000;
    --letter-paper: #fbfbf6;
    --polaroid-frame: #ffffff;
    --animation-duration: 0.7s;
    --letter-move-delay: 0.2s;
    --polaroid-start-delay: calc(var(--animation-duration) + var(--letter-move-delay) + 0.1s);
    --polaroid-move-duration: 0.8s;
    --papyrus-pattern: url('https://www.toptal.com/designers/subtlepatterns/uploads/papyrus.png');
    --paper-grain-texture: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.3" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.12"/></svg>');
}

/* Réinitialisation et styles globaux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light); 
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

/* Section Hero */
.hero {
    height: 100vh; 
    min-height: -webkit-fill-available; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1; 
}

.title-couple {
    font-family: 'Dancing Script', cursive; 
    font-size: 4.9rem;
    font-weight: 700;
    line-height: 1; 
    margin-bottom: 35px;
    margin-top: 10px;
    letter-spacing: 2px; 
    color : white;
    animation: fadeInDown 1.5s ease-out;
}

#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1; 
}

.hero-content {
    z-index: 10; 
    width: 100%;
    height: 100%;
    background-color: rgba(55, 63, 81, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Sélecteur de langue */
.language-selector {
    position: fixed;
    top: 15px; 
    right: 15px; 
    z-index: 20; 
    display: flex;
    gap: 10px;
}

.lang-icon img {
    width: 30px; 
    height: auto;
    border: 2px solid var(--text-light); 
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    opacity: 0.7; 
}

.lang-icon img:hover {
    transform: scale(1.1);
    opacity: 1; 
}

.lang-icon.active img {
    border-color: var(--accent-color); 
    opacity: 1; 
}

/* --- Animation de l'enveloppe (NOUVEAU) --- */
@keyframes floatEnvelope {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Styles de l'enveloppe */
.envelope-wrapper {
    position: relative;
    width: 380px;
    height: 250px;
    cursor: pointer;
    perspective: 1200px;
    margin: 20px auto;
    /* Application de l'animation de flottement */
    animation: floatEnvelope 3s ease-in-out infinite;
}
        
.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--envelope-base);
    border-radius: 8px;
    box-shadow: 0 8px 25px -5px rgba(0,0,0,0.3),
                inset 0 1px 1px 0 rgba(255,255,255,0.8),
                inset 0 -1px 1px 0 rgba(0,0,0,0.3);
    background-image: var(--papyrus-pattern);
    background-blend-mode: normal;
    background-size: 60px;
}

.envelope::before {
    content: '';
    position: absolute;
    top: 125px;
    left: 5px;
    right: 5px;
    height: 1px;
    background: var(--crease-line);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 3;
}

.recipient-text {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg); 
    font-family: 'Dancing Script', cursive;
    font-weight: 100;
    font-size: 26px;
    color: Grey;
    z-index: 7;
    pointer-events: none;
    mix-blend-mode: multiply; 
}

.letter {
    position: absolute;
    top: 10px; left: 12px; right: 10px;
    height: 90%;
    background-color: var(--letter-paper);
    background-image: var(--paper-grain-texture);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    z-index: 2;
    transition: transform var(--animation-duration) cubic-bezier(0.68, -0.55, 0.27, 1.55) var(--letter-move-delay),
                box-shadow var(--animation-duration) ease;
    display: flex;
    justify-content: center;
}

.letter-content {
    font-family: 'Dancing Script', cursive;
    color: #2c3e50;
    text-align: center;
    line-height: 1.5;
    font-size: 2.3rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    transition-delay: calc(var(--animation-duration) + var(--letter-move-delay));
    padding: 20px 40px 0 40px; 
    transform: rotate(-1deg); 
}

.letter-content .greeting {
    font-size: 24px;
    margin-bottom: 5px;
}

.letter-content .body-text {
    font-size: 23px;
}

.letter-content .body-text i {
    font-size: 19px;
}

.polaroid {
    position: absolute;
    width: 120px;
    height: 140px;
    background-color: var(--polaroid-frame);
    border-radius: 3px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    z-index: 1;
    transition: transform var(--polaroid-move-duration) cubic-bezier(0.68, -0.55, 0.27, 1.55) var(--polaroid-start-delay),
                opacity 0.2s ease-out var(--polaroid-start-delay);
}

.polaroid-image {
    width: 100px;
    height: 100px;
    position: absolute;
    top: 10px;
    left: 10px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
}

.polaroid-image.image-one {
    background-image: url("media/img3.png");
}

.polaroid-image.image-two {
    background-image: url("media/img4.png");
}

.polaroid-left, .polaroid-right {
    top: 0px;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
}
.polaroid-left { left: 145px; }
.polaroid-right { right: 120px; }

.flap-left, .flap-right, .flap-bottom {
    position: absolute;
    pointer-events: none;
}

.flap-left, .flap-right {
    width: 55%;
    height: 100%;
    z-index: 4;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent 60%), linear-gradient(to right, var(--envelope-dark-shadow), var(--envelope-inside));
}

.flap-right {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent 60%), linear-gradient(to left, var(--envelope-dark-shadow), var(--envelope-inside));
}

.flap-left::after, .flap-right::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--papyrus-pattern);
    background-blend-mode: overlay;
    background-size: 60px;
    box-shadow: inset 0px 0px 40px 0px rgba(0, 0, 0, 0.15);
}

.flap-left, .flap-left::after {
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.flap-right, .flap-right::after {
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.flap-bottom {
    bottom: 0; width: 100%; height: 55%;
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
    background-color: var(--envelope-base);
    z-index: 5;
    background-image: var(--papyrus-pattern);
    background-blend-mode: overlay;
    background-size: 60px;
    box-shadow: inset 0px 0px 40px 0px rgba(0, 0, 0, 0.2);
}

.flap-top {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 55%;
    transform-origin: top center;
    transform-style: preserve-3d;
    z-index: 6;
    transition: transform var(--animation-duration) ease-in-out,
                opacity calc(var(--animation-duration) / 2) ease-in-out,
                z-index 0s var(--animation-duration);
}

.flap-top-face {
    position: absolute;
    width: 100%; height: 100%;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    backface-visibility: hidden;
}

.flap-top-front {
    background-color: var(--envelope-base);
    box-shadow: inset 0px -70px 40px 10px rgba(0, 0, 0, 0.05);
    background-image: var(--papyrus-pattern);
    background-blend-mode: overlay;
    background-size: 60px;
}

.flap-top-back {
    background-color: var(--envelope-inside);
    transform: rotateX(180deg);
    background-image: var(--papyrus-pattern);
    background-blend-mode: overlay;
    background-size: 60px;
}

.calendar-button {
    margin-top: 20px;
    padding: 12px 24px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 16px;
    color: #fff;
    background-color: var(--accent-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transition-delay: calc(var(--polaroid-start-delay) + var(--polaroid-move-duration));
}

.calendar-button:hover {
    background-color: #A85A50;
}

/* --- Animation lors de l'ouverture --- */
.envelope-wrapper.open {
    /* On arrête l'animation de flottement quand c'est ouvert */
    animation: none; 
}

.envelope-wrapper.open .flap-top {
    transform: rotateX(180deg);
    opacity: 0;
    z-index: 0;
    transition: transform var(--animation-duration) ease-in-out,
                opacity calc(var(--animation-duration) / 2) ease-in-out,
                z-index 0s;
}

.envelope-wrapper.open .letter {
    transform: translateY(-130px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
}

.envelope-wrapper.open .letter-content {
    opacity: 1;
}

.envelope-wrapper.open .envelope::before {
    opacity: 1;
    transition-delay: calc(var(--animation-duration) / 2);
}

.envelope-wrapper.open .polaroid {
    opacity: 1;
    z-index: 7;
}

.envelope-wrapper.open .polaroid-left {
    transform: translateY(-70px) translateX(-210px) rotate(-10deg);
}
.envelope-wrapper.open .polaroid-right {
    transform: translateY(150px) translateX(140px) rotate(10deg);
}

.envelope-wrapper.open + .calendar-button {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Scroll Indicator */
.scroll-down-indicator {
    position: absolute;
    bottom: 20px;
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-light);
    border-radius: 50px;
    cursor: pointer;
    z-index: 10; 
}

.arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translate(-50%, -50%) rotate(45deg); }
    40% { transform: translateY(5px) translate(-50%, -50%) rotate(45deg); }
    60% { transform: translateY(2px) translate(-50%, -50%) rotate(45deg); }
}

/* Sections */
.details-section, .countdown-section {
    padding: 60px 20px;
    position: relative;
}

.details-section {
    background-color: var(--bg-light); 
}

.countdown-section {
    position: relative; /* Important pour que l'enfant absolute se repère par rapport à lui */
    padding: 30px 20px; /* Un peu plus d'espace pour profiter de l'image */
    overflow: hidden;
    background-color: #DDE2C6; /* On enlève la couleur de fond unie */
}

.details-section h2, .countdown-section h2 {
    font-family: 'Dancing Script', cursive; 
    font-size: 4rem;
    margin-bottom: 50px;
}

.detail-card {
    background-color: var(--primary-color); 
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 5px 5px 0 0 var(--secondary-color); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    max-width: 300px;
    vertical-align: top;
}

.detail-card:hover {
    transform: translateY(-5px); 
    box-shadow: 10px 10px 0 0 var(--text-dark); 
}

.detail-card h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.detail-card p {
    font-size: 0.9rem;
}

.fake-link {
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

.link-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.timer-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.timer-item {
    background-color: var(--accent-color); 
    padding: 20px 30px;
    border-radius: 5px;
    box-shadow: 0 5px 0 0 #A85A50;
    color: var(--text-light);
    min-width: 100px;
}

.timer-item span {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.timer-item p {
    font-size: 0.9rem;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Footer */
.footer {
    background-color: var(--bg-dark); 
    color: var(--text-light);
    padding: 20px 0;
    font-size: 0.8rem;
    text-align: center;
}

/* Animations au scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* Modal Vidéo & Hotel */
.modal {
    display: none;
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.8); 
    animation: fadeIn 0.3s ease-out;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal-content {
    position: relative; 
    margin: 0 auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%; 
    max-width: 800px;
    background-color: var(--bg-light);
    animation: slideIn 0.4s ease-out;
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 25px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

/* Styles pour la modale hotel */
.rates-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}
.rates-table th, .rates-table td {
    padding: 12px;
    border-bottom: 1px solid var(--primary-color);
}
.rates-table th {
    background-color: var(--secondary-color);
    color: var(--text-light);
}
.rates-table td s { color: #999; }
.price-details {
    text-align: center;
    font-style: italic;
    font-size: 0.9rem;
    color: #555;
}
.hotel-website-link {
    text-align: center;
    margin-top: 20px;
}
.hotel-website-link a {
    color: var(--accent-color);
    font-weight: bold;
}

.booking-form {
    margin-top: 30px;
    text-align: left;
    border-top: 2px solid var(--primary-color);
    padding-top: 20px;
}
.booking-form h3 {
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
}
.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.radio-group label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: normal;
}
.radio-group input[type="radio"] { margin-right: 10px; }
.booking-form button {
    width: 100%;
    text-align: center;
}

/* Styles pour la modale Calendrier */
.calendar-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}

.calendar-option-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-weight: bold;
}

.calendar-option-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Couleurs spécifiques */
.google-style {
    background-color: #4285F4; /* Bleu Google */
    color: white;
}

.apple-style {
    background-color: #333333; /* Gris sombre/Noir Apple */
    color: white;
}

/* 2. Le style de l'image de fond avec effet Parallaxe */
.bg-countdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* REMPLACEZ PAR LE NOM DE VOTRE FICHIER IMAGE */
    background-image: url('media/footer.png'); 
    
    background-size: 100%;   /* L'image couvre toute la zone */
    background-position: center bottom;
    background-repeat: no-repeat;
    
    /* C'est ici que la magie du parallaxe opère : */
    background-attachment: fixed; 
    
    z-index: 0; /* Derrière le texte */
    
    /* Optionnel : Assombrit l'image pour que le texte blanc reste lisible */
    filter: brightness(0.6); 
}

/* 3. On s'assure que le texte passe PAR-DESSUS l'image */
.countdown-section .container {
    position: relative;
    z-index: 2; /* Au premier plan */
}

/* Ajustement couleur du texte si nécessaire */
.countdown-section h2, 
.countdown-section p, 
.countdown-section .timer-item p {
    color: #ffffff; /* Texte en blanc pour contraster avec la photo */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Petite ombre pour la lisibilité */
}


/* Responsive */
@media (max-width: 768px) {

/* 1. Animation Spécifique Mobile qui inclut le scale(0.8) */
    @keyframes floatEnvelopeMobile {
        0%, 100% {
            transform: scale(0.8) translateY(0);
        }
        50% {
            transform: scale(0.8) translateY(-15px);
        }
    }

    .details-section h2, .countdown-section h2 {
        font-size: 3rem;
    }

    .detail-card {
        display: block;
        max-width: 100%;
        margin: 20px 0;
    }

    .timer-item {
        min-width: 80px;
        padding: 15px;
    }

    .timer-item span {
        font-size: 2.5rem;
    }
    
 .envelope-wrapper {
        /* 2. On remplace l'animation par défaut par la version mobile */
        transform: scale(0.8);
        margin-top: 0;
        animation: floatEnvelopeMobile 3s ease-in-out infinite;
    }

    .title-couple {
        font-size: 3.5rem;
    }

.bg-countdown {
        /* On repasse en mode normal pour que le JS puisse prendre le relais */
        background-attachment: scroll !important;
        
        /* L'image prendra toute la largeur, et sa hauteur naturelle */
        /* Cela évite le "zoom géant" */
        background-size: 400% !important; 
        
        background-position: center !important;
        margin-top:110px;
        background-repeat: no-repeat !important;
        
        /* On s'assure qu'elle est bien derrière */
        z-index: 0;
        
        /* Couleur de remplissage pour le bas de la section */
        
    }

    .countdown-section {
        position: relative;
        overflow: hidden; /* Important pour ne pas que l'image sorte */
        padding: 30px 20px;
    }
    
    /* On réduit aussi la taille du texte et de l'icône pour gagner de la place */
    .celebration-icon {
        max-width: 150px !important; /* Image plus petite */
        margin-bottom: 10px;
    }
    
    .countdown-section h2 {
        font-size: 2rem; /* Titre plus petit */
        margin-bottom: 20px;
    }

}