/* Variables CSS */
:root {
    --primary-color: #1e90ff; /* Bleu Dodger pour les accents */
    --secondary-color: #2c3e50; /* Bleu nuit pour les fonds */
    --background-color: #ecf0f1; /* Gris clair pour le fond général */
    --white-color: #ffffff;
    --text-color: #34495e; /* Gris foncé pour le texte */
    --light-gray: #bdc3c7;
    --hover-color: #2980b9;
    --accent-color: #e67e22; /* Orange pour les accents */
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    --transition-speed: 0.3s;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.2);
    --footer-height: 80px; /* Hauteur du footer */
}

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

/* Corps global */
html, body {
    display: flex;
    flex-direction: column;
    /* height: 100%; */ /* Supprimé pour permettre l'extension naturelle */
    font-family: var(--font-primary);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh; /* Assure que le corps prend au moins toute la hauteur de la fenêtre */
}

/* Navigation */
header {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-secondary);
    font-size: 2rem;
    color: var(--white-color);
    text-decoration: none;
    letter-spacing: 1px;
    cursor: pointer;
    font-weight: 700; /* Gras */
}

.menu {
    display: flex;
    list-style: none;
    gap: 25px;
}

.menu a {
    text-decoration: none;
    color: var(--white-color);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 8px;
    transition: background var(--transition-speed), transform var(--transition-speed);
    font-size: 1rem;
    cursor: pointer;
}

.menu a.active, .menu a:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

/* Bouton hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 35px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 20px;
    z-index: 1100;
}

.nav-toggle:focus {
    outline: none;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 35px;
    height: 4px;
    background-color: var(--white-color);
    border-radius: 2px;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    position: absolute;
}

.hamburger::before {
    top: -10px;
}

.hamburger::after {
    top: 10px;
}

.nav-toggle.open .hamburger {
    background-color: transparent;
}

.nav-toggle.open .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.open .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Contenu Principal */
main {
    flex: 1 0 auto; /* Ajusté pour permettre le défilement */
    padding: 60px 20px;
    text-align: center;
    position: relative;
    /* overflow: hidden; */ /* Supprimé */
    padding-bottom: var(--footer-height); /* Ajouté pour éviter que le contenu ne soit caché par le footer */
}

/* Animation fadeIn */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content {
    display: none;
    animation: fadeIn 0.8s ease-in-out;
}

.tab-content.active {
    display: block;
}

/* Section Bienvenue */
#welcome .intro-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.animated-text {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: fadeInText 2s ease-in-out;
    font-weight: 700; /* Gras */
}

@keyframes fadeInText {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-content p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.cta-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    transition: background var(--transition-speed), transform var(--transition-speed);
    font-size: 1.1rem;
    cursor: pointer;
}

.cta-btn:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
}

/* Slideshow d'Images */
.slideshow-container {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    overflow: hidden; /* Assure que tout débordement est masqué */
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    height: 350px; /* Hauteur ajustée */
}

.mySlides {
    display: none;
    position: relative;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

.slide-image {
    width: 100%;
    height: 100%; /* Utiliser la hauteur du conteneur */
    object-fit: cover; /* Recadrage des images */
    object-position: top center; /* Centrer l'image vers le haut */
    border-radius: 10px;
    transition: opacity 1.5s ease-in-out;
}

.caption {
    color: #f2f2f2;
    font-size: 1.2rem;
    padding: 8px 12px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 10px 10px;
}

/* Points de navigation */
.dot-container {
    text-align: center;
    padding: 20px;
    background: #ddd;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color var(--transition-speed);
}

.active-dot, .dot:hover {
    background-color: var(--primary-color);
}

/* Galerie */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-item {
    background-color: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    position: relative;
    padding-top: 100%;
}

.project-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-speed);
    cursor: pointer;
}

.project-item p {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    background: rgba(236, 240, 241, 0.95); /* Gris très clair semi-transparent */
    box-sizing: border-box;
    font-size: 1rem;
}

.project-item:hover {
    transform: translateY(-7px);
    box-shadow: var(--box-shadow-hover);
}

.project-item:hover img {
    transform: scale(1.1);
}

/* Lightbox - Zoom Image */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity var(--transition-speed);
}

.lightbox.show {
    display: flex;
}

.lightbox-content {
    max-width: 80%;
    max-height: 80%;
    border-radius: 10px;
    animation: zoomIn 0.5s ease;
}

.lightbox .close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--white-color);
    font-size: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-speed);
}

.lightbox .close:hover {
    color: var(--primary-color);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Section Contact */
#contact {
    background-color: var(--white-color);
    padding: 80px 20px;
    text-align: center;
}

#contact h2 {
    font-family: var(--font-secondary);
    font-size: 2.8rem;
    margin-bottom: 25px;
    color: var(--secondary-color);
    letter-spacing: 1px;
    font-weight: 700; /* Gras */
}

#contact p {
    margin-bottom: 40px;
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 850px;
    margin: 0 auto 40px;
}

.contact-container {
    display: flex;
    justify-content: center;
    gap: 35px;
    flex-wrap: wrap;
}

.contact-item {
    background: var(--light-gray);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 30px;
    width: 320px;
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.contact-item:hover {
    transform: translateY(-7px);
    box-shadow: var(--box-shadow-hover);
}

.contact-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.contact-item h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    font-family: var(--font-secondary);
    font-weight: 600; /* Gras */
}

.contact-item p {
    margin-bottom: 20px;
    color: #7f8c8d;
    font-size: 1rem;
}

/* Bouton de contact */
.contact-btn {
    display: inline-block;
    background-color: #0057d1;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease;
    white-space: normal; /* Permet de revenir à la ligne si nécessaire */
    word-wrap: break-word; /* Permet de couper le mot si trop long */
    text-align: center; /* Centre le texte */
    max-width: 100%; /* S’assure que le bouton ne dépasse pas la largeur du parent */
    box-sizing: border-box; /* Pour prendre en compte le padding dans la largeur totale */
}

.contact-btn:hover {
    background-color: #0041a8;
    transform: translateY(-2px);
}

/* Réseaux sociaux */
.social-links a {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin: 0 15px;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover {
    color: var(--accent-color);
    transform: scale(1.3);
}

/* Footer */
footer {
    position: fixed; /* Fixe le footer */
    bottom: 0; /* Positionne en bas */
    left: 0; /* Positionne à gauche */
    width: 100%; /* Prend toute la largeur */
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 25px;
    text-align: center;
    /* margin-top: auto; */ /* Supprimé */
    box-shadow: 0 -2px 7px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    font-family: var(--font-secondary);
    z-index: 1001; /* Assure qu'il est au-dessus des autres éléments */
}

/* Media Queries pour les appareils mobiles */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .menu {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100%;
        width: 250px;
        background-color: var(--secondary-color);
        flex-direction: column;
        padding-top: 70px;
        gap: 25px;
        transition: left var(--transition-speed) ease;
    }

    .menu.open {
        left: 0;
    }

    .menu a {
        font-size: 1.3rem;
        padding: 15px 25px;
    }

    main {
        padding: 70px 20px;
        padding-bottom: var(--footer-height); /* Assure que le contenu n'est pas masqué */
    }

    /* Ajustement des sections pour mobiles */
    .project-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-container {
        flex-direction: column;
        align-items: center;
    }

    .contact-item {
        width: 90%;
    }

    /* Slideshow Responsive */
    .slideshow-container {
        max-width: 100%;
        height: 250px; /* Hauteur ajustée pour mobile */
    }

    .slide-image {
        height: 100%; /* S'adapte à la nouvelle hauteur */
    }

    .dot-container {
        max-width: 100%;
    }

    /* Ajuster le footer pour mobile si nécessaire */
    footer {
        padding: 15px;
        font-size: 0.9rem;
    }
}

/* Styles supplémentaires pour assurer que le logo ne soit pas déformé */
.logo {
    display: inline-block;
}
