@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

/* --- Global Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style-type: none;
    font-family: 'Poppins', sans-serif;
}

html,
body {
    height: 100%;
    width: 100%;
}

body {
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Global overlay for menus/modals */
body.show-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 99; /* Below the header, above content */
    pointer-events: auto; /* Allow clicks on overlay to close */
    transition: background-color 0.3s ease; /* Smooth transition for overlay */
}

.container {
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Header & Navigation Styles --- */
header {
    position: fixed; /* Keep it fixed at the top */
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 101; /* Ensure header is always on top */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Subtle shadow for header */
}

nav {
    display: flex;
}

nav .wrapper {
    position: relative;
    width: 100%;
    padding: 5px 16px !important;
    margin-left: auto;
    max-width: 100vw;
    line-height: 70px; /* Adjust line-height to vertically center content if needed */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px; /* Fixed height for the nav wrapper */
}

.wrapper .logo a img {
    width: 200px;
    height: auto;
    align-items: center;
}

.wrapper .nav-links {
    display: flex;
    gap: 30px;
    flex-grow: 1;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.nav-links li {
    position: relative;
    display: block; /* Ensure li elements behave correctly in flex container */
}

/* Base style for desktop menu items */
.nav-links li a.desktop-item {
    position: relative;
    color: #010101;
    text-decoration: none;
    font-size: 15.25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex; /* Keep flex for icon alignment */
    align-items: center;
    line-height: inherit; /* Inherit line-height from parent (wrapper) */
    padding: 0 5px; /* Add some padding for clickable area */
}

.nav-links li a.desktop-item::after {
    position: absolute;
    content: '';
    width: 0;
    height: 1px;
    background: #010101;
    bottom: 0;
    left: 0;
    transition: 0.5s all;
}

.nav-links li a.desktop-item:hover::after {
    width: 100%;
}

.nav-links li a.desktop-item i {
    margin-left: 5px; /* Space between text and arrow icon */
    transition: transform 0.3s ease; /* Smooth arrow rotation */
}

/* Rotate arrow when menu is active */
.nav-links li.has-submenu.active a.desktop-item i {
    transform: rotate(180deg);
}

/* --- Mega Menu (Submenu) Styles - DESKTOP-SPECIFIC --- */
/* Ces règles sont pour l'affichage du mega-box sur les écrans larges */
.mega-box {
    position: absolute;
    top: calc(100% + 5px); /* Position juste en dessous du nav link */
    left: 50%;
    transform: translateX(-50%) translateY(0%);
    width: 100%; /* Prend 100% de la largeur du parent (`li.has-submenu`) */
    width: 100vw; /* DONNE AU SOUS-MENU LA LARGEUR COMPLÈTE DU NAVIGATEUR (viewport) */
    max-width: 750px; /* LIMITE SA LARGEUR MAXIMALE sur les grands écrans */
    padding: 20px; /* Rembourrage interne pour le contenu */
    box-sizing: border-box; /* Inclut le padding dans la largeur totale */

    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease; /* Smooth transition for open/close */
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-top: 3px solid #ffcc40; /* Accent border */
    z-index: 100; /* Au-dessus de l'overlay */
    max-height: max-content; /* S'assure que le contenu s'ajuste */
}

/* Show the mega-box when its parent li has 'active' class (controlled by JS) */
li.has-submenu.active .mega-box {
    opacity: 1;
    visibility: visible;
    transform:  translateX(-50%) translateY(0); /* Seulement le translateY pour l'animation */
    padding: 20px;
}

.mega-box .content {
    padding: 0; /* Géré par le padding du .mega-box parent */
    width: 100%; /* Prend toute la largeur disponible du .mega-box */
    display: grid;
    column-gap: 30px;
    row-gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Colonnes adaptatives */
    max-width: 1200px; /* IMPORTANT : même max-width que sur .mega-box pour centrer le contenu interne */
    margin: 0 auto; /* CENTRE LE CONTENU INTERNE */
}

.content .row {
    display: flex;
    gap: 15px;
    height: auto;
    align-items: center;
    transition: background-color 0.3s ease;
    padding: 10px;
    border-radius: 8px;
}

.content .row:hover {
    background: #f0f0f0;
}

.content .row .icon {
    font-size: 1.8em;
    color: #ffcc40;
    line-height: 0;
}

.content .row .text {
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.content .row .text p {
    line-height: 1.5;
    color: #777;
    font-size: 0.9em;
    margin: 0;
}

.content .row .text a {
    line-height: normal;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.content .row .text a::after {
    display: none;
}

.nav-links div[class*="mobile-item_"] {
    display: none;
}

/* --- Call to Action Buttons (CTA) --- */
.cta-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cta-buttons a.demo-btn {
    font-size: 14.88px;
    font-weight: 500;
    color: #010101;
    transition: 0.3s all;
    padding: 5px 8px;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
}
.cta-buttons a.demo-btn:hover {
    color: #fff;
    background: #010101;
}

.cta-buttons button {
    border-radius: 8px;
    padding: 6px 8px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14.75px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cta-buttons button.login-btn {
    background: none;
    border: 1px solid #010101;
    color: #010101;
}

.cta-buttons button.login-btn:hover {
    background: #919191;
    color: #fff;
    border-color: #919191;
}

button.signup-btn {
    background: #010101;
    color: #fff;
    border: 0;
}

button.signup-btn:hover {
    background: #3f3f3f;
}

button.language-btn {
    padding: 8px 10px;
    background: #FCCF40;
    color: #fff;
    border-radius: 3px;
    border: 0;
}
button.language-btn:hover {
    background: #e6b830;
}

h3[class*="titre_"] {
    font-size: 36px;
    color: #3A3B3C;
    text-align: center;
}

/* --- Footer Styles --- */
footer {
    margin: 5% auto 0 auto;
    background: #13315c;
    width: 100%;
}

.footer {
    margin: 0 auto;
}

.footer .footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-row .footer-col {
    flex: 1;
    min-width: 250px;
    margin-bottom: 20px;
}

.footer-row .footer-col h4 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 15px;
}

.footer-col .links {
    margin-top: 0;
}

.footer-col .links li {
    list-style: none;
    margin-bottom: 8px;
}

.footer-col .links li a {
    text-decoration: none;
    color: #bfbfbf;
    font-size: 0.95em;
}

.footer-col .links li a:hover {
    color: #fff;
}

.footer-col p {
    margin: 15px 0;
    color: #bfbfbf;
    max-width: 300px;
    font-size: 0.9em;
}

.footer-col form {
    display: flex;
    gap: 5px;
    margin-top: 15px;
}

.footer-col input {
    height: 40px;
    border-radius: 6px;
    background: none;
    width: 100%;
    outline: none;
    border: 1px solid #7489C6;
    caret-color: #fff;
    color: #fff;
    padding-left: 10px;
}

.footer-col input::placeholder {
    color: #ccc;
}

.footer-col form button {
    background: #fff;
    outline: none;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s ease;
}

.footer-col form button:hover {
    background: #cecccc;
}

.footer-col .icons {
    display: flex;
    margin-top: 25px;
    gap: 20px;
}

.footer-col .icons i {
    color: #afb6c7;
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.footer-col .icons i:hover {
    color: #fff;
}

/* Added for copyright text */
.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

/* --- Responsive Styles --- */

/* Cache les boutons menu/fermeture en desktop par défaut */
/* Cela doit être en dehors de toute media query pour être la règle par défaut pour le desktop */
.wrapper .btn {
    display: none;
}

/* Desktop to Tablet adjustments (1025px - 1260px) */
@media screen and (min-width: 1025px) and (max-width: 1260px) {
    .cta-buttons a.demo-btn {
        display: none;
    }

    .nav-links li a.desktop-item {
        font-size: 14px;
    }

    .nav-links {
        gap: 15px;
        align-items: center;
    }

    .cta-buttons button, .cta-buttons a {
        font-size: 13px;
        padding: 5px 10px;
    }

    @media screen and (min-width: 1066px) and (max-width: 1260px) {
        .wrapper .logo a img {
            width: 180px;
        }
    }
    @media screen and (min-width: 1025px) and (max-width: 1066px) {
        .wrapper .logo a img {
            width: 100px;
        }
    }
}

/* Tablet to Mobile adjustments (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        width: 100%;
        padding: 0 10px;
    }

    header {
        position: sticky;
        width: 100%;
    }

    .wrapper .btn {
        display: block; /* Affiche le bouton hamburger en mobile */
        color: #242526;
        font-size: 25px;
    }

    .wrapper .btn.close-btn {
        position: absolute;
        right: 20px;
        top: 20px;
        color: #fff;
        font-size: 25px;
        padding: 0;
    }

    .wrapper .nav-links {
        position: fixed;
        height: 100%;
        width: 100%;
        max-width: 300px;
        top: 0;
        left: -100%;
        background: #2c3e50;
        display: block;
        padding: 60px 0 0 20px;
        line-height: normal;
        overflow-y: auto;
        box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.18);
        transition: all 0.3s ease;
        z-index: 102;
    }

    #menu-btn:checked ~ .nav-links {
        left: 0%;
    }

    #menu-btn:checked ~ .btn.menu-btn {
        display: none;
    }

    .wrapper label.close-btn {
        display: block;
    }

    /* Mobile Menu Item Styles */
    .nav-links li {
        margin: 20px 0;
        display: block;
    }

    .nav-links li a.desktop-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.2em;
        color: #ecf0f1;
        padding: 10px 15px;
        border-radius: 5px;
        background: #34495e;
    }

    .nav-links li a.desktop-item:hover {
        background: #4a6681;
    }

    .nav-links div[class*="mobile-item_"] {
        display: none;
    }

    /* Mega-box behavior on Mobile - ces règles sont pour le menu VERTICAL */
    .mega-box {
        position: static !important; /* TRÈS IMPORTANT : annule le positionnement absolu du desktop */
        top: auto !important;
        left: auto !important;
        width: 100% !important; /* Prend la largeur du sidebar, pas 100vw */
        max-width: none !important; /* Important pour ne pas limiter la largeur sur mobile */
        opacity: 1 !important; /* Toujours visible pour l'animation max-height */
        visibility: visible !important; /* Toujours visible pour l'animation max-height */
        transform: translateY(0) !important; /* Réinitialise la transformation */
        box-shadow: none !important;
        border-top: none !important;
        padding: 0 10px;
        max-height: 0; /* Caché par défaut sur mobile pour animation */
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        background-color: transparent !important; /* Transparent pour s'intégrer au sidebar */
    }

    /* Show mobile mega-box when parent li has 'active' class */
    li.has-submenu.active .mega-box {
        max-height: 500px; /* Hauteur max pour l'expansion du contenu */
        transition: max-height 0.5s ease-in;
        padding-bottom: 20px;
    }

    .mega-box .content {
        display: flex;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: none;
        max-width: none; /* Annule le max-width du desktop pour le contenu interne mobile */
        margin: 0; /* Annule le margin auto pour le contenu interne mobile */
    }

    .mega-box .content .row {
        width: 100%;
        margin-bottom: 10px;
        padding: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mega-box .content .row:first-child {
        border-top: none;
    }

    .mega-box .content .row .text a {
        font-size: 1.1em;
        color: #ecf0f1;
    }
    .mega-box .content .row .text p {
        color: #bfbfbf;
    }
    .mega-box .content .row .icon {
        color: #ffcc40;
    }

    .cta-buttons {
        flex-direction: column;
        margin-top: 30px;
        align-items: center;
        gap: 15px;
    }
    .cta-buttons a.demo-btn, .cta-buttons button {
        width: 80%;
        max-width: 250px;
        text-align: center;
    }

    /* AJOUTÉ: Styles pour le survol/sélection des éléments du sous-menu sur mobile */
    /* Quand une ligne du sous-menu est survolée/tappée sur mobile */
    .mega-box .content .row:hover .text a,
    .mega-box .content .row.active .text a { /* La classe 'active' est si votre JS la gère au tap */
        color: #010101; /* Change le texte du lien en noir pour le rendre visible sur le fond clair */
    }

    .mega-box .content .row:hover .text p,
    .mega-box .content .row.active .text p { /* Pour la description */
        color: #333; /* Change le texte de la description en gris foncé */
    }
}

/* Mobile adjustments (max-width: 768px) */
@media screen and (max-width: 768px) {
    .footer .footer-row {
        padding: 20px;
        gap: 1rem;
        flex-direction: column;
        text-align: center;
    }
    .footer-row .footer-col {
        min-width: unset;
        width: 100%;
    }

    .footer-col h4::before {
        left: 50%;
        transform: translateX(-50%);
    }
    .footer-col .links,
    .footer-col p,
    .footer-col form {
        margin-left: auto;
        margin-right: auto;
    }
    .footer-col .links li {
        text-align: center;
    }

    .footer-col .icons {
        justify-content: center;
    }

    .footer-col form {
        display: flex;
        flex-wrap: wrap;
    }

    .footer-col form :where(input, button) {
        width: 100%;
    }

    .footer-col form button {
        margin: 10px 0 0 0;
    }
}

/* Very Small Mobile adjustments (max-width: 500px) */
@media screen and (max-width:500px) {
    .wrapper .logo a img {
        width: 180px;
    }

    .cta-buttons button.language-btn,
    .cta-buttons a.demo-btn {
        display: none;
    }

    .cta-buttons {
        width: 100%;
    }

    .cta-buttons button.login-btn,
    .cta-buttons button.signup-btn {
        width: 100%;
        justify-content: center;
    }
}

nav input {
    display: none; /* Cache les radio buttons */
}

/* --- Utility/Helper Classes (if any) --- */
.bg {
    background: #dad9d9a9 !important;
}