/* Hero Section */
.hero {
    position: relative;
    height: 93vh;
    width: 101%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

main{
    padding-top: 0;
}

/* Ajout du pseudo-élément pour la trame */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.1) 2px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 2px, transparent 1px);
    background-size: 3px 3px; /* Taille des carrés du quadrillage */
    z-index: 0;
    pointer-events: none;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-content {
    text-align: center;
    color: var(--white);
    z-index: 1;
    padding: 2rem;
    border-radius: 10px;
    padding-bottom: 20vh;
}

.hero-title {
    font-size: 15vw;
    margin-bottom: 0.1rem;
    font-weight: 600;
    color: white !important; /* Ajout de la couleur blanche */
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Optionnel: ajoute un effet d'ombre pour une meilleure lisibilité */
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 0.1rem;
    color: white; /* Ajout de la couleur blanche */
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Optionnel: ajoute un effet d'ombre pour une meilleure lisibilité */
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    width: 40px; /* Réduire de 40px à 24px */
    height: 40px; /* Réduire de 40px à 24px */
    fill: var(--white);
    display: block; /* Assure un meilleur centrage */
    margin: 0 auto; /* Centre horizontalement */
}

/* Ajustement de l'animation pour des mouvements plus subtils */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%); /* Réduit de -20px à -10px */
    }
    60% {
        transform: translateY(-5px) translateX(-50%); /* Réduit de -10px à -5px */
    }
}

/* Section About */
.about {
    min-height: 100vh;
    display: flex;
    position: relative;
}

.about-text {
    flex: 1;
    width: 40%;
    padding: 2rem;
    margin-top: 100vh; /* Commence après la section hero */
}

/* Classe ajoutée dynamiquement quand l'élément atteint la position souhaitée */
.about-text.fixed {
    position: fixed;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.project-showcase {
    flex: 1;
    margin-left: 50%; /* Pour compenser l'espace du texte fixe */
    width: 50%;
}

.reveal-text {
    font-size: 4vw;
    color: var(--text);
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.showcase-section {
    height: 100vh;
    width: 100%;
    position: relative;
}

.showcase-section img {
    width: 100%;
    height: 100vh;
    object-fit: cover;
}

.showcase-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.showcase-image.visible {
    opacity: 1;
    transform: scale(1);
}

/* Section post-hero avec le slogan */
.scroll-section {
    position: relative;
    min-height: 100vh;
    display: flex;
}

.text-container {
    position: relative;
    width: 40%;
    left: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh; /* Hauteur fixe */
    top: 50%; /* Position verticale initiale */
    transform: translateY(-50%); /* Centrage vertical initial */
}

.text-container.sticky {
    position: fixed;
    height: 100vh;
    top: 3%;
    transform: translateY(-50%);
    transition: none; /* Évite toute transition lors du passage en sticky */
}

.text-display {
    font-size: 4vw;
    color: var(--text);
    opacity: 1;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* États d'animation pour le texte */
.text-display.changing {
    opacity: 0;
    transform: translateY(20px);
}

.text-display.changing.next {
    transform: translateY(-20px);
}

.image-container {
    margin-left: auto;
    width: 50%;
    padding-top: 16vh;
}

.scroll-image {
    height: 100vh;
    width: 100%;
    position: relative;
}

.scroll-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-section {
    height: 80vh;
    width: 100%;
    position: relative;
    padding-right: 5vh;
}

.category-section img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease; /* Réduit de 1s à 0.3s */
    border-radius: 25px;
}

/* Classe ajoutée dynamiquement quand l'image est au centre */
.category-section img.visible {
    opacity: 1;
}

.contact-button-container {
    position: fixed;
    bottom: 5vh; /* Position depuis le bas */
    left: calc(5% + 20%); /* Aligné avec le texte (5% du left + moitié de la largeur du conteneur de texte) */
    transform: translateX(-50%); /* Centre le bouton */
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
    pointer-events: auto;
    width: fit-content;
    transition: opacity 0.5s ease;
}

.contact-button-container.visible {
    opacity: 1;
    visibility: visible;
}

.contact-button {
    display: inline-block;
    margin-bottom: 25vh;
    background-color: var(--primary-purple);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    cursor: pointer;
}

.contact-button:hover {
    background-color: var(--hover-purple);
    transform: translateY(-2px);
}

@media screen and (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    /* Garder la disposition horizontale mais ajuster les tailles */
    .scroll-section {
        flex-direction: row; /* Forcer la disposition horizontale */
    }

    .text-container {
        width: 45%; /* Légèrement plus large pour la lisibilité */
        position: relative;
        height: 70vh;
        margin-left: 1.4rem; /* Ajout d'une marge à gauche */
        justify-content: flex-start; /* Aligner le contenu à gauche */
    }

    .text-container.sticky {
    top:0;
    height: 75vh;
    margin-left: 1rem;
    transform: translateY(0%);


    }

    .text-display {
        font-size: 1.2rem; /* Taille de texte légèrement plus grande */
        line-height: 1.4;
        text-align: left; /* Forcer l'alignement à gauche */
        padding-right: 1rem; /* Espace à droite pour éviter que le texte ne touche les images */
    }

    .image-container {
        width: 45%; /* Ajuster la largeur des images */
        height: 60%;
        padding-left: 1rem; /* Espace entre le texte et les images */
        padding-bottom: 25vh;
    }

    .category-section {
        height: 100vh; /* Réduire la hauteur */
        padding-right: 1rem;
    }

    .category-section img,
    .category-section video {
        border-radius: 15px;
    }

    .contact-button-container {
        position: fixed;
        bottom: 3vh; /* Réduire légèrement la distance du bas */
        left: 50%; /* Centre par rapport à la largeur de l'écran */
        transform: translateX(-50%); /* Assure un centrage parfait */
        margin-left: 0; /* Retire la marge gauche précédente */
        width: fit-content;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.5s ease, visibility 0.5s ease;
    }

    .contact-button {
        margin-bottom: 10vh; /* Réduire la marge en bas */
        white-space: nowrap;
        text-align: center;
    }

    /* ... autres styles ... */

    /* Masquer le texte "Vos besoins" sur la dernière section */
    .category-section:last-child::after {
        content: none; /* Supprime le contenu after sur la dernière section */
    }

    /* Ajuster le seuil de déclenchement dans scrollAnimation.js */
    .category-section:last-child {
        margin-bottom: 15vh; /* Augmenter l'espace avant le bouton */
    }

    .category-section video,
    .category-section img {
        width: 100%;
        height: auto;
        aspect-ratio: 3/4 !important;
        border-radius: 15px;
        margin: 0 auto;
        object-fit: cover; /* Assure que la vidéo couvre bien l'espace */
    }

    /* Style spécifique pour les vidéos */
    .category-section video {
        height: 100%; /* Force la hauteur à 100% du conteneur */
    }
}

@media screen and (max-width: 768px) {
    /* Réorganisation du layout pour mobile */
    .scroll-section {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding-left: 3vw;
    }

    .text-container {
        display: none;
    }

    .image-container {
        width: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12vh;
        padding-top: 10vh;
        padding-bottom: 25vh; /* Augmenter le padding en bas */
    }

    .category-section {
        width: 80vw;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        margin-bottom: 2rem;
        text-align: center;
        
    }

    .category-section img,
    .category-section video {
        width: 100%;
        height: auto;
        aspect-ratio: 3/4 !important;
        border-radius: 15px;
        margin: 0 auto;
    }

    /* Style du texte sous les médias */
    .category-section::after {
        content: attr(data-text);
        display: block;
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
        color: var(--text);
        margin-top: 1rem;
        padding: 0 1rem;
    }
}
