/* ===================================
   VARIABLES & RESET
   =================================== */
:root {
    --primary-color: #75A13F;
    --primary-dark: #5a7f31;
    --primary-light: #8eb955;
    --secondary-color: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(117, 161, 63, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   PRELOADER
   =================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s, visibility 0.5s;
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    padding: 15px 0; /* Gardé ici pour la cohérence */
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-img {
    height: 90px;
    width: auto;
    transition: all 0.3s ease;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 0;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    position: relative;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    transition: var(--transition);
}

.dropdown-menu li a:hover {
    background: var(--primary-color);
    color: white;
}

.btn-nav {
    padding: 10px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-nav:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hamburger {
    display: none; /* Caché par défaut */
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===================================
   HERO SLIDER
   =================================== */
.hero-slider {
    position: relative;
    height: 100vh;
    overflow: hidden;
    margin-top: 80px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
    
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.btn {
    padding: 15px 35px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 10;
}

.slider-btn:hover {
    background: var(--primary-color);
}

.slider-btn.prev {
    left: 30px;
}

.slider-btn.next {
    right: 30px;
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active,
.dot:hover {
    background: white;
    transform: scale(1.2);
}

/* ===================================
   STATS SECTION
   =================================== */
.stats-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.stat-card {
    background: white;
    padding: 40px 20px;
    text-align: center;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.stat-number {
    font-size: 3rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 10px;
}

.stat-card p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ===================================
   SECTION HEADER
   =================================== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.title-line {
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 0 auto 15px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ===================================
   COURSES PREVIEW
   =================================== */
.courses-preview {
    padding: 80px 0;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.course-card {
    position: relative;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.course-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    /* Correction: la propriété background était répétée, j'ai gardé le dégradé initial si c'est ce que vous vouliez */
    /* background: linear-gradient(180deg, transparent 0%, rgba(117, 161, 63, 0.4) 100%); */
    transition: var(--transition);
}

.course-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(117, 161, 63, 0.9) 100%);
    transition: var(--transition);
}

.course-card:hover .course-image {
    transform: scale(1.1);
}

.course-card:hover .course-overlay {
    background: linear-gradient(180deg, rgba(117, 161, 63, 0.6) 0%, rgba(117, 161, 63, 0.75) 100%);
}

.course-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    color: white;
    z-index: 1;
}

.course-content h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.course-content p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.course-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    transition: var(--transition);
}

.course-link:hover {
    gap: 15px;
}

/* ===================================
   WHY US SECTION
   =================================== */
.why-us {
    padding: 80px 0;
    background: var(--bg-light);
}

.why-grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.why-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.why-item.reverse {
    direction: rtl;
}

.why-item.reverse > * {
    direction: ltr;
}

.why-image {
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.why-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.why-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* ===================================
   CTA SECTION
   =================================== */
.cta-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    background-image: url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?w=1920');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    text-align: center;
    color: white;
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(117, 161, 63, 0.9), rgba(90, 127, 49, 0.95));
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    background: white;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    gap: 15px;
}

/* ===================================
   MVV GRID (Vision, Mission, Valeurs)
   =================================== */
.mvv-grid {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 15px;
    flex-wrap: nowrap; /* Empêche le retour à la ligne sur grand écran */
    margin-top: 40px;
}

.mvv-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    flex: 1 1 23%; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 14px; 
    overflow: hidden;
}

.mvv-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.mvv-card .icon {
    font-size: 36px; 
    color: #0056A4;
    margin-bottom: 10px;
}

.mvv-card h3 {
    color: #222;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 16px; 
    text-transform: uppercase;
}

.mvv-card p {
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    text-align: left;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    background: #2c3e50;
    color: white;
}

.footer-top {
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.tagline {
    font-size: 0.9rem;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.footer-col p {
    color: #bdc3c7;
    line-height: 1.8;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--primary-light);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #bdc3c7;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    align-items: start;
    gap: 12px;
    margin-bottom: 15px;
}

.contact-info i {
    color: var(--primary-color);
    margin-top: 3px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom-content p {
    color: #bdc3c7;
    margin: 0;
}

.designer {
    font-size: 0.95rem;
}

.designer strong {
    color: var(--primary-light);
    font-weight: 700;
}

/* ===================================
   SCROLL TO TOP
   =================================== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* ===================================
   RESPONSIVE (Requêtes Médias)
   =================================== */

/* 💻 Écrans Moyens / Tablettes (max 1024px) */
@media (max-width: 1024px) {
    /* **WHY US** : Passer de 2 colonnes à 1 colonne */
    .why-item {
        display: flex; /* Utilisation de Flexbox pour une meilleure gestion de l'ordre */
        flex-direction: column; 
    }
    
    /* Le contenu vient avant l'image, même avec 'reverse' */
    .why-item > .why-content {
        order: 0; 
    }
    .why-item > .why-image {
        order: 1;
        margin-top: 30px;
    }
    
    /* Annuler la direction rtl/ltr qui n'a plus d'effet visuel sur une seule colonne */
    .why-item.reverse {
        direction: ltr;
    }
    .why-item.reverse > * {
        direction: ltr;
    }
    
    /* **FOOTER** : Passer de 4 colonnes à 2 colonnes */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 📱 Tablettes / Mobiles (max 992px) */
@media (max-width: 992px) {
    /* **MVV GRID** : Passer de 4 cartes à 2 cartes par ligne */
    .mvv-grid {
        flex-wrap: wrap; /* Permet le retour à la ligne */
    }
    .mvv-card {
        flex: 1 1 45%; /* Donne environ 45% de la largeur à chaque carte */
    }
}


/* 📲 Mobiles (max 768px) */
@media (max-width: 768px) {
    /* **NAVIGATION** : Activer le Hamburger et le Menu mobile */
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%; /* Cache le menu hors écran */
        width: 280px;
        height: calc(100vh - 80px);
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 40px 30px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
    }
    
    .nav-menu.active {
        right: 0; /* Affiche le menu */
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        box-shadow: none;
        padding-left: 20px;
    }
    
    /* **TYPOGRAPHIE** */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* **STATS** : Passer à 2 colonnes */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* **FOOTER** : Passer à 1 colonne */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* **SLIDER** */
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .slider-btn.prev {
        left: 15px;
    }
    
    .slider-btn.next {
        right: 15px;
    }
}

/* 📱 Petits Mobiles (max 600px) */
@media (max-width: 600px) {
    /* **MVV GRID** : Passer à 1 carte par ligne */
    .mvv-card {
        flex: 1 1 100%; /* Une seule carte par ligne */
    }
}

/* 📱 Très Petits Mobiles (max 480px) */
@media (max-width: 480px) {
    /* **TYPOGRAPHIE** */
    .hero-title {
        font-size: 1.5rem;
    }
    
    /* **GRILLES** : Tout passe à 1 seule colonne */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    /* **CTA** */
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }

    /* Forcer l'affichage des images sur mobile */
img {
    display: block !important;
    max-width: 100%;
    height: auto;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Pour les logos et images de navigation */
.logo-img,
.nav-logo img,
.course-image,
.why-image {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Désactiver temporairement AOS sur mobile pour tester */
@media (max-width: 768px) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
}