/* ==========================================================================
   1. STYLES DE BASE & MOBILE (Par défaut)
   ========================================================================== */
html, body {
    height: 100%; /* Indispensable pour mesurer la hauteur de l'écran */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f8f8; /* Fond très clair teinté selon le logo */
    color: #1c2d2e; /* Teinte sombre du logo pour le texte */
    line-height: 1.6;
    
    /* Système Flexbox pour pousser le footer en bas si la page est vide */
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    margin-top: 80px; /* Évite que le contenu mobile se cache sous le header fixe */
}

/* Ajustement de l'espace sous le header fixe sur mobile */
@media (max-width: 767px) {
    main {
        margin-top: 80px !important;
    }
}

/* ==========================================================================
   EN-TÊTE / HEADER & NAVIGATION (MOBILE & PC)
   ========================================================================== */
header.site-header {
    background-color: #0b5254; /* Bleu-Vert profond officiel du logo */
    color: white;
    padding: 10px 15px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

/* Conteneur de la ligne du haut sur mobile (Logo + Slogan + Burger) */
.header-container-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Style du Logo à gauche */
.logo-profile-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo-profile-image {
    width: 60px;  
    height: 60px; 
    border-radius: 50%; /* Cercle parfait */
    object-fit: cover; 
    border: 2px solid #14a4a6; /* Bordure Cyan éclatant du logo */
    background-color: white; 
    box-shadow: 0 2px 6px rgba(11, 82, 84, 0.15); 
    transition: transform 0.3s ease; 
}

.logo-profile-image:hover {
    transform: scale(1.05);
}

/* Le Slogan "LE POISSON, NOTRE PASSION." */
.header-slogan {
    font-size: 0.8rem;
    font-weight: 700;
    color:  white; 
    margin: 0 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bouton Menu Hamburger (Mobile) positionné à droite */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    padding: 5px;
}

/* Navigation principale (Cachée par défaut sur mobile, affichée avec .active) */
header.site-header nav.main-nav {
    display: none;
    width: 100%;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

header.site-header nav.main-nav.active {
    display: block !important;
}

header.site-header nav.main-nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

header.site-header nav.main-nav ul li {
    margin: 0;
}

/* Liens du menu (Effets Hover & Active) gérés sur TOUS les écrans */
header.site-header nav.main-nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 17px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

/* Survol (Hover) : Rouge d'origine et fond léger */
header.site-header nav.main-nav ul li a:hover {
    color: #e04a3a !important; 
    background-color: rgba(255, 255, 255, 0.1); 
}

/* Page active : Rouge d'origine avec ligne en dessous sur tous les appareils */
header.site-header nav.main-nav ul li a.active {
    color: #e04a3a !important; 
    font-weight: bold !important;
    border-bottom: 2px solid #e04a3a !important; 
    border-radius: 0 !important; 
}


/* ==========================================================================
   2. ADAPTATION POUR ORDINATEUR / LAPTOP (Écrans moyens et grands >= 768px)
   ========================================================================== */
@media (min-width: 768px) {
    main {
        margin-top: 100px; /* Ajuste la hauteur sous le header PC */
    }

    header.site-header {
        display: flex;
        justify-content: space-between; /* Logo à gauche, Menu à droite */
        align-items: center;
        padding: 10px 5%; 
        height: 85px;
    }

    .header-container-mobile {
        width: auto;
    }

    .logo-profile-wrapper {
        min-width: auto;
    }

    .logo-profile-image {
        width: 65px;  
        height: 65px; 
    }

    .header-slogan {
        font-size: 0.95rem;
        margin-left: 20px;
    }

    /* Cache le bouton burger sur PC */
    .menu-toggle {
        display: none !important;
    }

    /* Force l'affichage de la navigation en ligne à droite */
    header.site-header nav.main-nav {
        display: flex !important;
        width: auto;
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }

    header.site-header nav.main-nav ul {
        flex-direction: row;
        gap: 20px; 
        align-items: center;
    }

    .hero {
        padding: 80px 20px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
    }
    
    .social-icons a:hover {
        transform: translateY(-5px); 
    }

    .services-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 25px;
    }
    
    .card:hover {
        transform: translateY(-10px); 
    }
}


/* ==========================================================================
   3. ADAPTATION POUR TÉLÉVISION / PROJECTEUR (Très grands écrans >= 1920px)
   ========================================================================== */
@media (min-width: 1920px) {
    body {
        font-size: 22px; 
    }

    .hero h1 {
        font-size: 55px;
    }

    .social-icons a {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr); 
    }
}


/* ==========================================================================
   STYLE DE LA PAGE CONTACT
   ========================================================================== */
.contact-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-info, .contact-form {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(11, 82, 84, 0.05);
}

.contact-info i {
    color: #14a4a6; 
    margin-right: 10px;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    color: white !important;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: bold;
    gap: 10px;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.whatsapp-btn:hover {
    background-color: #1ebd59;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

.submit-btn {
    background-color: #14a4a6; 
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #0b5254; 
}

@media (min-width: 768px) {
    .contact-container {
        flex-direction: row; 
    }
    .contact-info, .contact-form {
        flex: 1; 
    }
}

.maps-link {
    color: #14a4a6; 
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.maps-link:hover {
    color: #0b5254; 
    text-decoration: underline;
}


/* ==========================================================================
   COMPOSANTS SPÉCIFIQUES & EFFETS DE SURVOL (HOVER)
   ========================================================================== */
.featured-formations .phare-card a {
    transition: all 0.3s ease !important; 
}

.featured-formations .phare-card a,
.services-grid .phare-card a,
.services-grid .card a {
    transition: all 0.3s ease !important; 
    display: inline-block;
}

.featured-formations .phare-card a:hover,
.services-grid .phare-card a:hover,
.services-grid .card a:hover {
    transform: translateY(-3px) !important; 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important; 
    filter: brightness(1.1) !important; 
    text-decoration: none !important; 
    cursor: pointer;
}

.services-grid .card a {
    display: inline-block;
    transition: all 0.3s ease;
}

.services-grid .card a:hover {
    padding-left: 8px; 
    color: #e04a3a !important; 
    text-decoration: underline; 
    cursor: pointer;
}


/* ==========================================================================
   STYLE DU FOOTER PROFESSIONNEL ET RESPONSIVE
   ========================================================================== */
.site-footer {
    background-color: #0b5254;
    padding: 20px 5%;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
}

.site-footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.site-footer .footer-legal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.site-footer .legal-item {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.site-footer .legal-item:nth-child(2) {
    text-align: center;
}

.site-footer .legal-item:nth-child(3) {
    text-align: right;
}

.site-footer .social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #ffffff !important; 
    text-decoration: none;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.icon-facebook { background-color: #1877F2; }
.icon-instagram { background-color: #E1306C; }
.icon-youtube { background-color: #FF0000; }
.icon-linkedin { background-color: #0077B5; }
.icon-whatsapp { background-color: #25D366; }
.icon-tiktok { background-color: #010101; }

@media (max-width: 768px) {
    .site-footer {
        padding: 25px 20px; 
    }

    .site-footer .footer-legal {
        flex-direction: column; 
        gap: 12px;
        text-align: center; 
        padding-bottom: 20px;
    }

    .site-footer .legal-item,
    .site-footer .legal-item:nth-child(2),
    .site-footer .legal-item:nth-child(3) {
        text-align: center; 
        width: 100%;
        font-size: 0.85rem; 
    }
}


/* ==========================================================================
   SECTION NOS COMMUNAUTÉS
   ========================================================================== */
.community-section {
    background-color: #f9fbfb; 
    padding: 60px 5%;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.community-container {
    max-width: 1200px;
    margin: 0 auto;
}

.community-title {
    color: #0b5254; 
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.community-subtitle {
    color: #555;
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto 40px auto;
    line-height: 1.6;
}

.community-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.community-card {
    background: #ffffff;
    border: 1px solid rgba(11, 82, 84, 0.1);
    border-radius: 12px;
    padding: 30px 25px;
    flex: 1;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.community-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(11, 82, 84, 0.1);
}

.comm-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin-bottom: 20px;
}

.whatsapp-group .comm-icon { background-color: #25D366; }
.whatsapp-channel .comm-icon { background-color: #128C7E; }
.facebook-group .comm-icon { background-color: #1877F2; }

.community-card h3 {
    color: #0b5254;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.community-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
    text-align: center;
}

.comm-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s ease, color 0.3s ease;
    width: 100%;
}

.whatsapp-group .comm-btn, .whatsapp-channel .comm-btn {
    background-color: transparent;
    border: 2px solid #25D366;
    color: #25D366;
}
.whatsapp-group .comm-btn:hover, .whatsapp-channel .comm-btn:hover {
    background-color: #25D366;
    color: #fff;
}

.facebook-group .comm-btn {
    background-color: transparent;
    border: 2px solid #1877F2;
    color: #1877F2;
}
.facebook-group .comm-btn:hover {
    background-color: #1877F2;
    color: #fff;
}

@media (max-width: 768px) {
    .community-title { font-size: 1.8rem; }
    .community-section { padding: 40px 20px; }
    .community-grid { gap: 20px; }
    .community-card { max-width: 100%; }
}


/* ==========================================================================
   SECTION VIDÉO ET CARROUSEL D'IMAGES (ACCUEIL)
   ========================================================================== */
.media-section {
    padding: 60px 5%;
    background-color: #ffffff;
    font-family: 'Poppins', sans-serif;
}
.media-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 50px; 
}
.section-title {
    color: #0b5254;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.slider-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}
.slider-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    background-color: #f4f8f8; /* Fond doux pour éviter les flashs blancs */
}
.slider-track {
    display: flex;
    /* CORRIGÉ : On passe de 8s à 0.5s pour que le glissement soit fluide et normal */
    transition: transform 0.5s ease-in-out;
    width: 100%;
}
.slide {
    min-width: 100%; 
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Carrousel d'images : Forcé en mode entier (contain) partout */
.slide img {
    width: 100% !important;
    height: 450px !important;
    object-fit: contain !important; /* Empêche définitivement l'image d'être coupée ou zoomée */
    background-color: #f4f8f8 !important; /* Fond propre autour de l'image */
    display: block !important;
}

/* Ajustement mobile pour le carrousel */
@media (max-width: 768px) {
    .slide img {
        height: 250px !important;
        object-fit: contain !important;
    }
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(11, 82, 84, 0.8);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}
.slider-btn:hover { background-color: #14a4a6; }
.prev-btn { left: -15px; }
.next-btn { right: -15px; }

@media (max-width: 768px) {
    .section-title { font-size: 1.4rem; }
    .slider-btn { width: 35px; height: 35px; font-size: 16px; }
    .prev-btn { left: 5px; }
    .next-btn { right: 5px; }
}

/* ==========================================================================
   STYLES COMPLÉMENTAIRES POUR LES MESSAGES DE L'IA
   ========================================================================== */
.bot-message {
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6; 
    font-size: 14px;
    max-width: 85%;
    word-wrap: break-word;
}

.bot-message strong {
    color: #0b5254; 
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.ai-bullet {
    display: block;
    padding-left: 10px;
    margin-bottom: 4px;
    color: #334155;
}

.ai-msg {
    line-height: 1.6 !important; 
}

.emak-strong {
    color: #0b5254; 
    font-weight: 700;
    display: inline-block;
    margin-top: 4px;
}

.emak-list-item {
    margin-top: 6px;
    margin-bottom: 4px;
    padding-left: 5px;
}
.emak-list-num {
    font-weight: bold;
    color: #0b5254;
    margin-right: 4px;
}

.emak-bullet-item {
    margin-bottom: 3px;
    padding-left: 10px;
}
.emak-bullet {
    color: #0b5254;
    margin-right: 6px;
}

@media (max-width: 767px) {
    main {
        margin-top: 75px !important;
    }
    .hero {
        padding-top: 20px !important; /* Rapproche le titre tout près du header sur mobile */
    }
}

/* ==========================================================================
   BOUTON RETOUR EN HAUT (BACK TO TOP)
   ========================================================================== */
#backToTopBtn {
    position: fixed;
    bottom: 120px;
    right: 25px;
    z-index: 999;
    background-color: #e04a3a; /* Couleur principale du header/footer */
    color: white;
    border: none;
    outline: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#backToTopBtn:hover {
    background-color: #e04a3a; /* Cyan éclatant du logo au survol */
    transform: translateY(-3px);
}