/* ============================================
   HEADER - STYLES COMPLETS (ÉPURÉ)
   ============================================ */

* {
    font-family: 'Poppins', sans-serif;
}

/* ============================================
   BLOC A : TOPBAR (Barre supérieure)
   ============================================ */

.topbar {
    background: #ffffff;
    color: #333;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #e4e4e4;
}

.topbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Liste des contacts à gauche */
.topbar-list {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topbar-list li {
    display: flex;
    align-items: center;
    gap: 5px;
}

.topbar-list i {
    display: none;
}

.topbar-list a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.topbar-list a:hover {
    color: #00a8b5;
}

/* Réseaux sociaux à droite */
.topbar-social {
    display: flex;
    gap: 15px;
    align-items: center;
}

.topbar-social a {
    color: #333;
    font-size: 16px;
    transition: color 0.3s ease;
}

.topbar-social a:hover {
    color: #00a8b5;
}

/* ============================================
   BLOC B : NAVBAR (Barre de navigation)
   ============================================ */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 2rem;
    background-color: #202d4b;
    position: relative;
    z-index: 999;
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
}

.navbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    gap: 1rem;
}

/* --- BLOC GAUCHE : LOGO --- */

.logo-block {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 0.6rem;
    flex-shrink: 0;
}

.logo-block img {
    height: 60px;
    width: auto;
    transition: height 0.3s ease;
}

/* --- BLOC CENTER : MENU DE NAVIGATION --- */

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.3rem;
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 400;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00a8b5;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.25rem;
    width: 0;
    height: 2px;
    background-color: #00a8b5;
    transition: width 0.2s ease;
}

.nav-links a:hover::after {
    width: 0%;
}

/* Éléments de liste */
.nav-links li {
    position: relative;
}

/* Icône flèche pour les sous-menus */
.nav-links .has-submenu > a::after {
    content: "\f107";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    display: inline;
    margin-left: 6px;
    font-size: 0.75rem;
    color: #ffffff;
    position: static;
    width: auto;
    height: auto;
    background: none;
}

/* --- SOUS-MENUS : SUBMENU --- */

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 30px 40px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
}

/* Mega Menu 4+ colonnes (La FFPP) */
.nav-links .has-submenu.mega-menu {
    position: relative;
}

.nav-links .has-submenu.mega-menu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(-10px);
    width: 1150px;
    max-width: 95vw;
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
    background-color: #ffffff;
    background-image: 
        radial-gradient(circle at 90% 90%, rgba(76, 207, 222, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" opacity="0.03"><circle cx="150" cy="150" r="80" fill="%234CCFDE"/><circle cx="50" cy="50" r="40" fill="%234CCFDE"/></svg>');
    background-size: 100%, 300px;
    background-position: center, bottom right;
    background-repeat: no-repeat;
    padding: 45px;
    border-top: 3px solid #4CCFDE;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-links .has-submenu.mega-menu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega Menu 1 colonne (Formations, Déontologie, Adhérents) */
.nav-links .has-submenu.mega-menu-single {
    position: relative;
}

.nav-links .has-submenu.mega-menu-single .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(-10px);
    width: 400px;
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
    background-color: #ffffff;
    background-image: 
        radial-gradient(circle at 90% 90%, rgba(76, 207, 222, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" opacity="0.03"><circle cx="150" cy="150" r="80" fill="%234CCFDE"/><circle cx="50" cy="50" r="40" fill="%234CCFDE"/></svg>');
    background-size: 100%, 300px;
    background-position: center, bottom right;
    background-repeat: no-repeat;
    padding: 45px;
    border-top: 3px solid #4CCFDE;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-links .has-submenu.mega-menu-single:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-links .has-submenu.mega-menu-single .submenu-column {
    padding-right: 0;
}

.nav-links .has-submenu.mega-menu-single .submenu-column::after {
    display: none;
}

/* Colonnes du sous-menu */
.submenu-column {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-right: 20px;
}

.submenu-column:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent 0%, rgba(76, 207, 222, 0.2) 20%, rgba(76, 207, 222, 0.2) 80%, transparent 100%);
}

.submenu-column h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: #202d4b;
    margin: 0 0 15px 0;
    padding: 0 0 8px 0;
    border-bottom: 2px solid rgba(76, 207, 222, 0.15);
    position: relative;
    transition: all 0.3s ease;
}

.submenu-column h4::before {
    content: '▸';
    margin-right: 6px;
    opacity: 0;
    transition: all 0.3s ease;
    display: inline-block;
    transform: translateX(-5px);
}

.submenu-column h4:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.submenu-column h4 a {
    color: #202d4b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.submenu-column h4:hover a {
    color: #4CCFDE;
    padding-left: 5px;
}

.submenu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu-column li {
    padding: 0;
    margin: 0;
    position: relative;
}

.submenu-column li a {
    display: block;
    padding: 8px 0 8px 12px;
    font-size: 14px;
    color: #90908c;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 400;
    line-height: 22px;
    border-radius: 4px;
    position: relative;
}

.submenu-column li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #4CCFDE;
    transition: height 0.3s ease;
    border-radius: 2px;
}

.submenu-column li a:hover {
    color: #202d4b;
    background: rgba(76, 207, 222, 0.08);
    padding-left: 16px;
}

.submenu-column li a:hover::before {
    height: 70%;
}

.nav-links .has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    padding: 0;
}

.submenu li a {
    display: block;
    padding: 8px 20px;
    font-size: 0.95rem;
    color: #333;
    font-weight: 400;
    position: relative;
}

.submenu li a:hover {
    background: rgba(76, 207, 222, 0.1);
    color: #4CCFDE;
}

.submenu li a::after {
    display: none;
}

/* --- BLOC DROIT : ICÔNES + BOUTON --- */

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.icon-button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.icon-button:hover {
    opacity: 0.7;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #ffffff;
}

/* Bouton CTA */
.btn-primary {
    background-color: #4ccfde;
    color: #ffffff;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #3db8c7;
}

/* --- MENU BURGER MOBILE --- */

.mobile-burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
}

.mobile-burger span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.mobile-burger.open span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.mobile-burger.open span:nth-child(2) {
    opacity: 0;
}

.mobile-burger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablettes (1200px et moins) */
@media (max-width: 1200px) {
    .navbar {
        padding: 0.7rem 1.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }
}

/* Mobiles (768px et moins) */
@media (max-width: 768px) {
    .topbar-container {
        flex-direction: column;
        gap: 8px;
        padding: 0 0.8rem;
    }

    .topbar-list {
        gap: 15px;
        flex-wrap: wrap;
    }

    .navbar {
        padding: 0.7rem 1rem;
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .navbar-wrapper {
        grid-column: 1 / -1;
        display: none;
        flex-direction: column;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .navbar-wrapper.open {
        display: flex;
    }

    .navbar-center {
        flex-direction: column;
        margin: 0;
        width: 100%;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .nav-links li {
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .navbar-left {
        display: none;
    }

    .navbar-right {
        gap: 0.5rem;
        display: none;
    }

    .navbar-wrapper.open .navbar-left,
    .navbar-wrapper.open .navbar-right {
        display: flex;
    }

    .navbar-right {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #f0f0f0;
    }

    .mobile-burger {
        display: flex;
    }

    .btn-primary {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        width: 100%;
        text-align: center;
    }

    /* Masquer les sous-menus sur mobile */
    .submenu {
        position: static;
        opacity: 0;
        visibility: hidden;
        display: none;
        transform: none;
        box-shadow: none;
        padding: 0;
        background: none;
        border: none;
    }
}

/* Très petit écran (480px et moins) */
@media (max-width: 480px) {
    .topbar {
        padding: 5px 0;
        font-size: 11px;
    }

    .topbar-social {
        gap: 10px;
    }

    .navbar {
        padding: 0.5rem 0.8rem;
    }

    .logo-block img {
        height: 45px;
    }

    .navbar-right {
        gap: 0.3rem;
    }

    .btn-primary {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }

    .nav-links {
        font-size: 0.8rem;
    }

    .navbar-center {
        width: 100%;
    }
}
