/* Basic CSS Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary, 
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

/* --- FONDATIONS & DESIGN SYSTEM --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Lato:wght @400;700&display=swap');

:root {
    --font-main: 'Lato', sans-serif;
    --font-special: 'Bebas Neue', sans-serif;
    --color-green: #2c5530;      /* Vert forêt, plus profond */
    --color-earth: #8b4513;      /* Terre/Or, plus riche */
    --color-dark: #333;       /* Presque noir, plus doux */
    --color-light: #f8f6f2;      /* Blanc cassé */
    --color-white: #FFFFFF;
    --color-red: #FF0000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    font-family: var(--font-main);
    background-color: var(--color-light);
    color: var(--color-dark);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body.no-scroll {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Ensure container respects width */
}

/* --- ANIMATIONS D'APPARITION --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* --- HEADER --- */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 50px;
    width: auto; /* Ensure aspect ratio is maintained */
}

.logo-subtitle p {
    margin: 0;
    font-size: 1rem;
    font-family: var(--font-main);
    color: var(--color-green);
    font-weight: bold;
}

/* Desktop Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--color-green);
    font-weight: 500;
    transition: color 0.3s ease;
    padding-bottom: 0.5rem;
}

nav a:hover {
    color: var(--color-earth);
}

nav a.active {
    background-color: #808080; /* Gray */
    color: var(--color-white);
    border-bottom: 2px solid var(--color-red);
}

/* Mobile Navigation (Hamburger) */
.menu-toggle {
 display: none; /* Supprime !important */
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    width: 25px;
    height: 20px;
    z-index: 1001;
    position: relative;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-green);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger to X animation */
.menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    flex-direction: column;
    justify-content: flex-start; /* Align items to the top */
    align-items: center;
    transform: translateX(100%); /* Start off-screen */
    transition: transform 0.4s ease-out;
    margin: 0; /* Ensure no external margins */
    padding: 0; /* Ensure no external padding */
    height: calc(100vh - 70px); /* Take full height minus header */
    overflow-y: auto; /* Enable scrolling for long menus */
}

.mobile-nav.open {
    transform: translateX(0); /* Slide in */
    display: flex; /* Show the mobile nav */
}

.mobile-nav ul {
    list-style: none; /* Remove bullet points */
    flex-direction: column;
    text-align: center;
    gap: 0; /* No gap, padding on links */
    padding: 1rem 0; /* Padding for the list */
    width: 100%;
}
.mobile-nav a {
    font-size: 1.2rem; /* Slightly smaller, more refined */
    color: var(--color-green);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s, transform 0.3s; /* Added transform for subtle effect */
    padding: 1rem 2rem; /* Add padding for clickable area */
    display: block; /* Make links block-level for padding */
    text-transform: uppercase; /* Make it structured */
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
}
.mobile-nav a:hover, .mobile-nav a.active {
    color: var(--color-white);
    background-color: var(--color-green);
    transform: translateX(5px); /* Subtle slide effect on hover */
}

main {
    padding-top: 70px; /* Restaurer l'espacement pour le contenu sous le header */
}

/* --- PAGE D'ACCUEIL : HERO --- */
.hero-video {
    position: relative;
    height: 100vh;
    margin-top: -70px; /* Compenser le padding de main pour le hero remplisse l'écran */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    object-fit: cover;
}

.hero-video::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Voile noir semi-transparent */
    z-index: -1;
}

.hero-content {
    text-align: center;
    color: var(--color-white);
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 10rem; /* Ajout d'un padding en bas pour l'indicateur de défilement */
}

.hero-content h1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem; /* Espace ajusté */
    margin-bottom: 2rem;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6); /* Ombre plus subtile */
}

/* Titre principal plus raffiné */
.hero-content .main-title {
    font-family: var(--font-special);
    font-size: clamp(3rem, 6vw, 5.5rem); /* Plus grand et responsive */
    font-weight: 700; /* Plus affirmé */
    line-height: 1.1;
}

/* Services Cards */
.services-wrapper {
    margin-top: 3rem;
}

.services-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.services-intro h2 {
    font-size: 2.5rem;
    color: var(--color-white);
    margin-bottom: 1rem;
    font-weight: 300;
}

.services-intro p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.15); /* Glassmorphism effect */
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--color-dark);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    color: var(--color-white); /* Icons should be white on glassmorphism */
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-white);
    font-weight: 600;
}

.service-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    word-break: break-word;
    flex-grow: 1;
}

.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-white);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.service-cta:hover {
    color: var(--color-earth);
}

.service-cta::after {
    content: '→';
    transition: transform 0.3s ease;
}

.service-card:hover .service-cta::after {
    transform: translateX(5px);
}

/* Scroll indicator */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-white);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
}

.scroll-indicator span {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-indicator .arrow {
    width: 24px;
    height: 24px;
    animation: bounce-arrow 2s ease-in-out infinite;
}

@keyframes bounce-arrow {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
    }
}

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



/* Content sections */
.page-section {
    padding: 4rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.page-section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.intro-section {
    background: var(--color-white);
    text-align: center;
}

.intro-wrapper p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-green), var(--color-earth));
    color: var(--color-white);
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Counters */
.counters-section {
    background: linear-gradient(135deg, var(--color-green), var(--color-earth));
    color: var(--color-white);
}

.counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.counter {
    padding: 2rem;
}

.counter .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.counter .number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.counter .text {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Flip cards */
.page-section h2 {
    text-align: center;
    font-family: var(--font-special);
    font-size: 2.5rem;
    color: var(--color-green);
    margin-bottom: 2rem;
}

.flip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    height: 200px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.flip-card-front {
    background: linear-gradient(135deg, var(--color-green), var(--color-earth));
    color: var(--color-white);
}

.flip-card-back {
    background: var(--color-white);
    color: var(--color-dark);
    transform: rotateY(180deg);
}

.flip-card-front h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.flip-card-back p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Footer */
footer {
    background: var(--color-green);
    color: var(--color-white);
    text-align: center;
    padding: 2rem 0;
}

/* --- CORRECTIONS RESPONSIVE --- */

/* Correction pour les appareils mobiles */
@media (max-width: 768px) {
    /* Ajustement de la hauteur du hero pour mobile */
    .hero-video {
        height: auto;
        min-height: 100vh;
        padding: 70px 0 2rem;
    }

    .hero-video.video-loading {
        background-color: lightgray;
    }
    
    /* Correction pour le contenu hero sur mobile */
    .hero-content {
        padding: 2rem 1rem;
    }
    
    /* Ajustement de la grille des services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    /* Correction des cartes de service */
    .service-card {
        min-height: auto;
        padding: 1.5rem;
    }
    
    /* Ajustement de la taille du texte pour mobile */
    .service-card h3 {
        font-size: 1.3rem;
    }
    
    .service-card p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    /* Masquer la vidéo sur mobile si nécessaire et afficher le fallback */
    #background-video {
        /* display: none; */ /* Removed */
    }
    
    
    
    /* Ajustement des compteurs */
    .counters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .counter {
        padding: 1rem;
    }
    
    .counter .number {
        font-size: 2rem;
    }

    .menu-toggle {
        display: flex;
        width: 25px;
        height: 20px; /* Adjust height for 3 lines */
        z-index: 10000; /* Increased z-index */
        position: relative; /* For animation */
    }

    .menu-toggle span {
        display: block !important;
        background-color: var(--color-green) !important; /* Ensure color */
    }

    .menu-toggle::before {
        content: '☰'; /* Hamburger icon character */
        display: block !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 30px !important; /* Large size */
        color: blue !important; /* Distinct color */
        z-index: 9999 !important; /* Highest z-index */
        background-color: yellow !important; /* Debugging background */
        width: 40px !important;
        height: 40px !important;
        text-align: center !important;
        line-height: 40px !important;
    }

    header .container {
        justify-content: space-between;
        gap: 1rem;
    }

    .logo-subtitle {
        display: block;
    }

    .logo-container {
        flex-shrink: 0;
    }

    nav {
        display: none !important;
    }

/* Correction spécifique pour Android */
@media (max-width: 480px) and (orientation: portrait) {
    .services-grid {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .service-card {
        margin: 0 0.5rem;
    }
    
    /* S'assurer que le contenu ne dépasse pas */
    .container {
        overflow-x: hidden;
    }
    
    /* Ajustement des flip cards */
    .flip-card {
        height: 180px;
    }
}

/* Correction pour le menu mobile */
@media (max-width: 768px) {
    .mobile-nav {
        height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling sur iOS */
    }
    
    .mobile-nav ul {
        padding: 1rem 0;
    }
    
    .mobile-nav a {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* Empêcher le zoom sur les champs de formulaire sur iOS */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px; /* Empêche le zoom sur iOS */
    }
}

/* Correction pour le défilement fluide sur mobile */
html, body {
    -webkit-overflow-scrolling: touch;
}

/* Ajustements pour très petits écrans */
@media (max-width: 360px) {
    .service-card {
        padding: 1rem;
    }
    
    .service-icon {
        font-size: 2rem;
    }
    
    .counter .icon {
        font-size: 2rem;
    }
    
    .counter .number {
        font-size: 1.8rem;
    }
}

/* Correction pour l'indicateur de défilement */
.scroll-indicator {
    bottom: 1rem;
}

@media (max-width: 768px) {
    .scroll-indicator {
        display: none; /* Masquer sur mobile pour économiser de l'espace */
    }
}

/* Correction pour les animations qui pourraient causer des problèmes sur mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
