@import url('https://fonts.googleapis.com/css2?family=Hepta+Slab:wght@1..900&display=swap');
*
{margin: 0; 
padding: 0; 
box-sizing: border-box;
font-family: 'Hepta Slab', serif;}

p, h1, h2 {
    /* Apply a very subtle shadow */
    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.295); 
}

/* Sections */
section.home {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh; /* Garder 100vh pour la page d'accueil */
    background: url(/css/background.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 50px;
}
.container {
    position: relative;
    width: calc(100% - 100px); /* Largeur de la section */
    min-height: calc(100vh - 280px); /* Hauteur de la section */
    min-height: 300px; /* Hauteur minimale de la section */
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px;
    padding-top: 80px; /* Décalage vers le haut */
}

.about {
    min-height: auto; /* Changez de 100vh à auto */
    padding: 80px 50px; /* Réduisez le padding */
    background: url(/css/background.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.7);
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
}

.about-content {
    width: calc(100% - 100px);
    padding: 40px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column; /* Changé pour empiler le texte et les icônes */
    gap: 30px;
}

.about-content img {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    object-fit: cover;
}

.about-content p {
    font-size: 1.2em;
    color: #383838;
    line-height: 1.6;
}

.skills-icons {
    width: 100%;
}

.skills-icons h3 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Augmentez la taille minimale */
    gap: 20px;
    justify-items: center;
    padding: 10px; /* Ajoutez du padding autour de la grille */
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    transition: all 0.3s ease;
    min-height: 120px;
    position: relative; /* Crucial for the pseudo-element */
    overflow: hidden; /* Hides the gradient outside the border-radius */
}

.skill-item::before {
    content: "";
    position: absolute;
    top: var(--y, 50%); /* Fallback to center */
    left: var(--x, 50%); /* Fallback to center */
    transform: translate(-50%, -50%);
    width: 150px; /* Size of the glow */
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; /* Ne pas interférer avec les clics */
}

.skill-item:hover::before {
    opacity: 1;
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.skill-item img {
    width: 60px; /* Augmentez légèrement la taille */
    height: 60px;
    object-fit: contain; /* Important pour garder les proportions */
    flex-shrink: 0; /* Empêche le rétrécissement */
}

.skill-item span {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    text-align: center; /* Centre le texte */
    word-wrap: break-word; /* Permet le retour à la ligne si nécessaire */
}

/* Section Contact */
.contact {
    min-height: auto;
    padding: 80px 50px;
    background: url(/css/background.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.7);
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.contact-form {
    width: 100%;
    max-width: 1600px; /* Augmentez encore plus la largeur maximale */
    padding: 60px; /* Augmentez le padding */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 18px; /* Augmentez le padding */
    margin-bottom: 25px; /* Augmentez l'espacement */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 1.1em; /* Augmentez la taille de police */
    background: rgba(255, 255, 255, 0.7);
}

.contact-form textarea {
    min-height: 200px; /* Augmentez la hauteur du textarea */
    resize: vertical;
}

.contact-form button {
    padding: 18px 50px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    isolation: isolate;
}

.contact-form button::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.9) 90deg,
        transparent 180deg,
        rgba(255, 255, 255, 0.9) 270deg,
        transparent 360deg
    );
    border-radius: 12px;
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.6s ease;
    filter: blur(2px);
    z-index: -2; /* Changé de -1 à -2 */
}

.contact-form button::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: #333;
    border-radius: 8px;
    z-index: -1; /* Reste à -1, au-dessus du ::before */
}

/* Assurez-vous que le texte est au-dessus */
.contact-form button {
    position: relative;
}

.contact-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-form button:hover::before {
    opacity: 1;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Projets */
.projets {
    min-height: auto; /* Changez de 100vh à auto */
    padding: 80px 50px; /* Réduisez le padding */
    padding-top: 120px; /* Gardez un peu plus d'espace en haut pour le header */
    background: url(/css/background.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projets h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 30px;
}

.projets-content {
    width: calc(100% - 100px);
    padding: 40px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 40px;
    align-items: center;
}

.projets-content img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.projets-content p {
    flex: 1;
    font-size: 1.2em;
    color: #555;
    line-height: 1.6;
}

.projets-content-link,
.carousel-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.projets-content-link:hover .projets-content,
.carousel-link:hover .carousel-container {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    position: fixed; /* Positionnement absolu */
    top: 0; /* Décalage vers le haut */
    right: 20px; /* Décalage vers la droite */
    left: 80px;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.55); /* Blanc transparent */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px); /* Effet de flou */
    border: 1px solid rgba(255, 255, 255, 0.25); /* Bordure blanche transparente */  
    border-top: 1px solid rgba(255, 255, 255, 0.5); /* Bordure blanche transparente */  
    border-left: 1px solid rgba(255, 255, 255, 0.5); /* Bordure blanche transparente */  
    z-index: 1000; /* Au-dessus des autres éléments */
    transition: all 0.3s ease; /* Transition douce */
}
/* Classe pour le header rétracté lors du défilement */
header.scrolled {
    padding: 10px 100px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

header .logo {
    font-size: 2em;
    font-weight: 700;
    color: #333; /* Couleur du texte */
    text-decoration: none; /* Pas de soulignement */
}

header ul {
    display: flex;
}

header ul li {
    list-style: none; /* Pas de puces */
    margin: 0 10px; /* Espacement entre les éléments */
}

header ul li a {
    text-decoration: none; /* Pas de soulignement */
    color: #333; /* Couleur du texte */
    font-weight: 400; /* Poids de la police */
    padding: 8px 15px; /* Espacement interne */
    border-radius: 25px; /* Coins arrondis */
}

header ul li a:hover,
header ul li a.active {
    background: rgba(255, 255, 255, 0.75); /* Fond transparent au survol */
    color: #333; /* Couleur du texte au survol */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); /* Ombre au survol */
    transition: all 0.3s ease; /* Transition douce */
}
.content {
    transform: translateX(-100px); /* Décalage vers la gauche */
    max-width: 700px; /* Largeur maximale */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px); /* Effet de flou */
    border: 1px solid rgba(255, 255, 255, 0.25); /* Bordure blanche transparente */  
    border-top: 1px solid rgba(255, 255, 255, 0.5); /* Bordure blanche transparente */  
    border-left: 1px solid rgba(255, 255, 255, 0.5); /* Bordure blanche transparente */  
    padding: 40px; /* Espacement interne */
    padding-left: 110px; /* Espacement interne */
}
.content h1 {
    font-size: 3em; /* Taille de la police */
    color: #333; /* Couleur du texte */
}
.content p {
    font-size: 1.2em; /* Taille de la police */
    color: #555; /* Couleur du texte */
}
.content a {
    display: inline-block; /* Affichage en bloc */
    padding: 15px 30px; /* Espacement interne */
    background: rgba(255, 255, 255, 0.75); /* Fond sombre */
    color: #333; /* Couleur du texte */
    margin-top: 20px; /* Marge supérieure */
    border-radius: 30px; /* Coins arrondis */
    font-size: 1.2em; /* Taille de la police */
    font-weight: 500; /* Poids de la police */
    text-decoration: none; /* Pas de soulignement */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); /* Ombre */
}
.content a:hover {
    background: rgba(255, 255, 255, 0.85); /* Fond sombre au survol */
    color: #333; /* Couleur du texte au survol */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); /* Ombre au survol */
}
.image-container {
    width: 240px;          /* Largeur fixe (4) */
    height: 300px;         /* Hauteur fixe (5) */
    position: relative;    /* Pour le positionnement absolu de l'image */
    overflow: hidden;      /* Cache ce qui dépasse */
    border-radius: 20px;   /* Coins arrondis */
    transform: translateX(-50px); /* Déplace l'image vers la gauche */
    margin-left: -30px;    /* Décalage supplémentaire vers la gauche */
}
.image-container img {
    position: absolute;    /* Positionnement absolu */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;     /* Force le rognage */
    object-position: center;
}
.social-links {
    position: absolute; /* Positionnement absolu */
    right: -25px; /* Décalage vers la droite */
    display: flex; /* Affichage en flex */
    justify-content: center; /* Centrage horizontal */
    align-items: center; /* Centrage vertical */
    flex-direction: column; /* Alignement vertical */
}
.social-links li {
    list-style: none; /* Pas de puces */
}
.social-links li a {
    text-decoration: none; /* Pas de soulignement */
    width: 50px; /* Largeur fixe */
    height: 50px; /* Hauteur fixe */
    background: rgba(255, 255, 255, 0.75); /* Fond sombre */
    display: flex; /* Affichage en flex */
    justify-content: center; /* Centrage horizontal */
    align-items: center; /* Centrage vertical */
    border-radius: 50%; /* Coins arrondis */
    margin: 5px 0; /* Marge supérieure et inférieure */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); /* Ombre */
}
.social-links li a img {
    width: 25px; /* Largeur de l'icône */
    height: 25px; /* Hauteur de l'icône */
}
.social-links li a:hover {
    transform: scale(1.2); /* Agrandissement de l'icône au survol */
    transition: transform 0.5s ease; /* Transition douce */
    background: rgba(255, 255, 255, 0.9); /* Fond sombre au survol */
}

h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.7);
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
}

footer {
    position: relative;
    padding: 20px 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    margin: 10px 20px;
    width: calc(100% - 180px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px;
    min-width: 300px;
    overflow: hidden; /* Cache tout ce qui dépasse */
}

footer p {
    color: #333;
    font-size: 1.1em;
    background: transparent; /* Assure un fond transparent */
    border-radius: 20px;
}

footer .social-links {
    position: static;
    flex-direction: row;
    gap: 10px;
    margin: 0;
    background: transparent; /* Assure un fond transparent */
}

footer .social-links li a {
    width: 40px;
    height: 40px;
    margin: 0;
}

footer .social-links li a img {
    width: 20px;
    height: 20px;
}

/* Carousel Styles - Premier carousel (projet-1) */
.carousel-container {
    width: 80%;
    max-width: 1200px;
    margin: 40px auto;
    position: relative;
}

.carousel {
    position: relative;
    width: 100%;
    height: 500px; /* Hauteur normale pour le premier carousel */
    overflow: hidden;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover pour le premier carousel */
    flex-shrink: 0;
}

/* Style spécifique pour le deuxième carousel (projet-2) uniquement */
#projet-2 .carousel {
    height: 600px; /* Hauteur plus grande */
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
}

#projet-2 .carousel-slide {
    object-fit: contain; /* Contain pour voir l'image entière */
    padding: 30px; /* Espace autour de l'image */
}

/* Ajustez la hauteur du carousel si nécessaire */
.carousel {
    position: relative;
    width: 100%;
    height: 600px; /* Augmentez la hauteur */
    overflow: hidden;
    border-radius: 15px;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.nav-dot.active {
    background: rgba(255, 255, 255, 0.9);
}

/* Réalisations */
.realisations {
    position: relative;
    padding-top: 120px;
    min-height: 100vh;
    overflow: hidden;
    text-align: center;
}

.realisations h2 {
    color: #fff;
    font-size: 2.5em;
    text-align: center;
    margin: 0 auto 40px auto;
    display: inline-block;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

/* Add this new class for the background */
.realisations::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(8px);
    z-index: -1;
}

/* Update the gallery container to ensure content is clear */
.gallery {
    position: relative;
    column-count: 4;
    column-gap: 20px;
    padding: 20px;
    z-index: 1;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    display: block;
}

/* Add media queries for responsive columns */
@media screen and (max-width: 1200px) {
    .gallery {
        column-count: 3;
    }
}

@media screen and (max-width: 900px) {
    .gallery {
        column-count: 2;
    }
}

@media screen and (max-width: 600px) {
    .gallery {
        column-count: 1;
    }
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border-radius: 10px; /* Keep corners consistent */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    cursor: pointer;
}

/* Add video styles to match images */
.gallery-item video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.gallery-item:hover img {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Add hover effect for videos */
.gallery-item:hover video {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.gallery-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-description {
    transform: translateY(0);
}

/* Gestion spécifique pour les vidéos */
.gallery-item:has(video) .gallery-description {
    bottom: auto;
    top: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.gallery-item:has(video):hover .gallery-description {
    transform: translateY(0);
}

.gallery-item:has(video) .gallery-description h3,
.gallery-item:has(video) .gallery-description p {
    pointer-events: auto;
}

.gallery-description h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.gallery-description p {
    margin: 0;
    font-size: 0.9em;
}
.projet-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.projet-link:hover {
    opacity: 0.7;
}

.projet-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.projet-link:hover::after {
    width: 100%;
}
/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s ease-in-out;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content,
.modal-video {
    max-width: 90%;
    max-height: 80vh;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.6s ease-in-out;
    border-radius: 10px;
}

.modal.show .modal-content,
.modal.show .modal-video {
    transform: scale(1);
    opacity: 1;
}

.modal-caption {
    margin-top: 20px;
    color: #fff;
    text-align: center;
    font-size: 1em;
    max-width: 80%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-in-out;
    line-height: 1.6;
}

.modal.show .modal-caption {
    opacity: 1;
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: all 0.5s ease;
}

.modal.show .modal-close {
    opacity: 1;
}

.modal-close:hover {
    color: #bbb;
}

/* Helper classes for scroll animations */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hidden-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hidden-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* State when elements become visible */
.visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1em;
    display: none;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.5);
    display: block;
}

.form-message.error {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.5);
    display: block;
}

.contact-form button:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- Form Status Message Styles --- */

#form-status {
    margin-top: 20px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 500;
}

#form-status p {
    padding: 15px;
    border-radius: 8px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Style for the success message */
#form-status .success {
    background-color: rgba(40, 167, 69, 0.8); /* A nice semi-transparent green */
    border: 1px solid rgba(40, 167, 69, 1);
}

/* Style for the error message */
#form-status .error {
    background-color: rgba(220, 53, 69, 0.8); /* A clear semi-transparent red */
    border: 1px solid rgba(220, 53, 69, 1);
}

/* ========================================= */
/*      MEDIA QUERIES FOR MOBILE DEVICES     */
/* ========================================= */

@media (max-width: 768px) {

    /* --- FIX FOR FULL-WIDTH BACKGROUND --- */
    body {
        /* Remove ALL side padding on mobile */
        padding: 0;
        margin: 0;
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    /* Make sections take full width */
    section.home,
    section.about,
    section.contact,
    section.projets,
    section.realisations {
        padding: 0;
        margin: 0;
        width: 100%;
    }

    /* --- Section Spacing --- */
    section.about,
    section.contact,
    section.projets {
        /* Add space at the top and bottom of each section */
        padding-top: 80px !important;
        padding-bottom: 60px !important; 
    }

    /* --- 1. General Container and Body Adjustments (REVISED) --- */

    .container, 
    .about-content, 
    .contact-form, 
    .projets-content {
        /* Make containers centered with equal margins */
        width: calc(100% - 30px);
        max-width: 100%;
        margin: 0 15px; /* Explicitly set equal left and right margins */
        padding: 25px;
        flex-direction: column;
        text-align: center;
        box-sizing: border-box; /* Include padding in width calculation */
    }

    /* --- 2. Header Adjustments (REVISED) --- */
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        padding: 10px 15px;
        width: 100%;
        box-sizing: border-box;
        
        flex-direction: row; 
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    /* Make logo smaller on mobile */
    header .logo {
        font-size: 1.5em; 
    }

    /* Adjust nav links spacing */
    header ul {
        gap: 10px; /* Space between the links */
        margin: 0;
        padding: 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    header ul li {
        margin: 0; /* Remove extra margin on list items */
    }

    /* --- 3. Hero Section (REVISED) --- */
    
    /* This is the main section containing everything */
    section.home {
        /* INCREASE the top padding to push the content down from the fixed header */
        padding-top: 120px;
        padding-bottom: 40px;
        /* Remove min-height to let content flow naturally */
        min-height: auto;
    }

    /* This is the main glass container in the hero section */
    .home .container {
        padding: 25px; /* A bit more padding inside the glass */
        gap: 25px; /* More space between your photo, text, and buttons */
        min-height: auto;
    }

    .content {
        /* Reset the negative transforms used for desktop layout */
        transform: none; 
        padding: 15px; /* Reduce padding inside the text's own container */
        max-width: 100%;
        order: 2; /* Make the text appear AFTER the photo */
    }

    .image-container {
        transform: none;
        margin: 0 auto; /* Center the image */
        width: 120px; /* Make photo even smaller */
        height: 120px;
        border-radius: 50%; /* A circular portrait looks great on mobile */
        order: 1; /* Make the photo appear FIRST */
    }

    .social-links {
        /* Move social links from the side to the bottom */
        position: static; /* Remove absolute positioning */
        flex-direction: row; /* Arrange them horizontally */
        justify-content: center;
        gap: 15px; /* Reduce space between social icons */
        margin-top: 20px;
        order: 3; /* Make them appear last */
    }

    .content h1 {
        font-size: 2.2em; /* Reduce heading size for mobile */
    }

    .content p {
        font-size: 1.1em; /* Adjust paragraph size */
    }

    /* --- 4. "À Propos", "Contact", and "Projets" Page Adjustments --- */
    
    .about-content,
    .contact-form,
    .projets-content {
        /* More comfortable padding for mobile */
        padding: 30px 20px; 
    }

    /* Adjust the main paragraph text inside the "about" section */
    .about-content p {
        font-size: 1.0em; /* Slightly smaller text is easier to read in long blocks */
        line-height: 1.7; /* INCREASE line-height for better readability */
        text-align: left; /* Keep left-aligned, it's better for mobile */
    }

    /* Adjust spacing for the skills grid */
    .skills-icons {
        margin-top: 30px;
    }

    /* --- Skills Grid --- */
    .icons-grid {
        /* Force a 2-column layout for a cleaner, more spacious feel on mobile */
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px; /* Add a bit more space between the icons */
    }

    /* Make carousels shorter on mobile */
    .carousel {
        height: 300px; 
    }
    
    #projet-2 .carousel {
        height: 350px;
    }

    /* --- 5. Skills and Footer --- */
    h2 {
        /* Reduce the size of section titles */
        font-size: 2em;
        padding: 10px 20px;
        margin-top: 20px; /* Add extra top margin */
        margin-bottom: 25px; /* Add extra bottom margin */
    }

    footer {
        flex-direction: column; /* Stack copyright and social links */
        gap: 15px;
        width: 100%;
        margin: 10px 0;
        border-radius: 0;
        text-align: center;
    }
}

