/* ==================== COQUE DU SITE (navigation, pied de page, chatbot) ====================
   Accueil (body.layout-home) : menu vertical ancré sur les sections, barre supérieure + menu coulissant sur mobile.
   Autres pages (body.layout-pages) : menu horizontal, menu agence à droite, barre des services (sidebar-onglet.css).
   Pied de page premium partout.
   Les couleurs passent par des variables redéfinies par le thème clair (theme-light.css). */

:root {
    --nav-width: 260px;
    --topbar-height: 64px;
    --gold: #D4AF37;
    --gold-dim: rgba(212, 175, 55, 0.75);
    --gold-gradient: linear-gradient(135deg, #D4AF37, #f3d47c);
    /* Couleur d'accent du thème : or en sombre, bleu en clair (redéfinie dans theme-light.css).
       Les noms --gold… sont historiques : ils désignent l'accent, quel que soit le thème. */
    --gold-rgb: 212, 175, 55;
    --gold-light: #f0d060;
    --on-gold: #050505;
    --accent: #D4AF37;
    --accent-rgb: 212, 175, 55;
    --accent-strong: #f0d060;
    --accent-soft: rgba(212, 175, 55, 0.08);
    --accent-gradient: linear-gradient(135deg, #D4AF37, #f0d060);
    --hero-gradient: radial-gradient(ellipse at 80% 0%, rgba(212, 175, 55, 0.14), transparent 55%), linear-gradient(135deg, #050505 0%, #0b0b0b 60%, #14110a 100%);
    --shell-bg: #0a0a0a;
    --shell-border: rgba(var(--gold-rgb), 0.25);
    --shell-text: rgba(255, 255, 255, 0.6);
    --shell-text-strong: #ffffff;
    --shell-hover: rgba(var(--gold-rgb), 0.08);
    --page-bg: #050505;
    --footer-bg: linear-gradient(135deg, #0a0a0a 0%, #111111 100%);
    --navbar-height: 76px;
    --navbar-bg: rgba(8, 8, 8, 0.94);
    /* Contenus des pages (y compris les blocs hérités de l'ancien thème blanc) */
    --content-heading: #ffffff;
    --content-text: rgba(255, 255, 255, 0.85);
    --content-muted: rgba(255, 255, 255, 0.62);
    --content-surface: #111111;
    --content-surface-alt: #0b0b0b;
    --content-border: rgba(255, 255, 255, 0.08);
    --content-input-bg: rgba(255, 255, 255, 0.04);
    --content-link: var(--gold);
    /* Bootstrap en mode sombre : mêmes fonds que le site */
    --bs-body-bg: #050505;
    --bs-body-color: rgba(255, 255, 255, 0.85);
    --bs-secondary-color: rgba(255, 255, 255, 0.62);
    --bs-emphasis-color: #ffffff;
    --bs-heading-color: #ffffff;
    --bs-border-color: rgba(255, 255, 255, 0.1);
}

body {
    background: var(--page-bg);
}

/* Le fond « futuriste » de style.css ne doit pas recouvrir la coque */
body::before {
    display: none;
}

/* ---------- Contenu principal ---------- */
.main-container-premium {
    margin-left: 0;
    min-height: 100vh;
    background: var(--page-bg);
    position: relative;
    overflow-x: hidden; /* anciens navigateurs */
    overflow-x: clip; /* coupe le débordement sans créer de zone de défilement : position: sticky fonctionne dans les pages */
    display: flex;
    flex-direction: column;
}

.main-container-premium > main {
    flex: 1 0 auto;
}

/* Les pages internes gardent leur propre marge sous la barre fixe (padding-top dans chaque page) */
.layout-home .main-container-premium {
    margin-left: var(--nav-width);
}

/* ---------- Accueil : menu vertical ---------- */
.sidebar-premium {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--nav-width);
    background: var(--shell-bg);
    border-right: 1px solid var(--shell-border);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    padding: 1.75rem 0 1.5rem;
    overflow-y: auto;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--shell-border);
    position: relative;
}

.sidebar-logo img {
    max-width: 160px;
    height: auto;
}

.sidebar-close {
    display: none;
    position: absolute;
    right: 1rem;
    top: 0;
    background: none;
    border: none;
    color: var(--shell-text-strong);
    font-size: 1.2rem;
}

.sidebar-premium .nav-links {
    list-style: none;
    padding: 1rem 0.75rem 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-premium .nav-item {
    margin-bottom: 0.25rem;
    padding: 0;
    text-align: center;
}

.nav-link-premium {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    padding: 0.95rem 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--shell-text);
    border-radius: 8px;
    transition: background 0.25s ease, color 0.25s ease;
}

.nav-link-premium i {
    font-size: 1.4rem;
    color: var(--gold);
    transition: transform 0.25s ease;
}

.nav-link-premium:hover i {
    transform: translateY(-2px);
}

.nav-link-premium:hover {
    background: var(--shell-hover);
    color: var(--shell-text-strong);
}

.nav-link-premium.active {
    background: rgba(var(--gold-rgb), 0.14);
    color: var(--gold);
}

.sidebar-account-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: var(--shell-text);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.25rem;
}

.sidebar-account-link:hover {
    color: var(--gold);
}

.sidebar-footer {
    padding: 1.25rem 1.25rem 0;
    border-top: 1px solid var(--shell-border);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cta-sidebar {
    background: var(--gold);
    color: var(--on-gold);
    padding: 0.8rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    display: block;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(var(--gold-rgb), 0.4);
    color: #020617;
}

/* ---------- Bascule de thème ---------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--shell-border);
    background: transparent;
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.25s ease;
}

.theme-toggle:hover {
    background: var(--shell-hover);
}

.theme-toggle-wide {
    width: 100%;
    height: auto;
    border-radius: 50px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    color: var(--shell-text-strong);
}

.theme-toggle-wide i {
    color: var(--gold);
}

/* En thème sombre, le bouton propose le clair, et inversement */
.theme-icon-dark, .theme-label-dark { display: none; }
[data-theme="light"] .theme-icon-light, [data-theme="light"] .theme-label-light { display: none; }
[data-theme="light"] .theme-icon-dark, [data-theme="light"] .theme-label-dark { display: inline; }

/* ---------- Barre supérieure (mobile) ---------- */
.topbar-premium {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .layout-home .main-container-premium {
        margin-left: 0;
        padding-top: var(--topbar-height);
    }

    .topbar-premium {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--topbar-height);
        padding: 0 1rem;
        background: var(--shell-bg);
        border-bottom: 1px solid var(--shell-border);
        z-index: 1030;
    }

    .topbar-logo img {
        height: 30px;
        width: auto;
    }

    .topbar-burger {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 1px solid var(--shell-border);
        background: transparent;
        color: var(--gold);
        font-size: 1.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-premium {
        transform: translateX(-100%);
        width: min(300px, 85vw);
        z-index: 1050;
    }

    .sidebar-close {
        display: block;
    }

    body.sidebar-open .sidebar-premium {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1045;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* ---------- Pages internes : menu horizontal ---------- */
.navbar-site {
    min-height: var(--navbar-height);
    padding: 0.55rem 0;
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--shell-border);
    z-index: 1040;
}

.navbar-site .navbar-brand img {
    width: auto;
    height: 44px;
}

.navbar-site .navbar-nav {
    gap: 0.5rem;
}

.navbar-site .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--shell-text-strong) !important;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem !important;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.35rem 0.9rem !important;
    border-radius: 8px;
    line-height: 1.3;
}

.navbar-site .nav-link:hover {
    color: var(--gold) !important;
    background: var(--shell-hover);
    transform: none;
}

.navbar-site .nav-link.active {
    color: var(--gold) !important;
}

.navbar-site .nav-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--shell-text);
    white-space: nowrap;
}

.navbar-site .navbar-toggler {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--shell-border);
    color: var(--gold);
    font-size: 1.2rem !important;
    padding: 0;
    box-shadow: none;
}

.btn-agence-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    margin-left: 0;
}

.btn-agence-toggle svg {
    fill: var(--gold);
}

@media (max-width: 991.98px) {
    .navbar-site .navbar-brand img {
        height: 34px;
    }

    .navbar-site .navbar-collapse {
        padding: 0.75rem 0 0.25rem;
    }

    .navbar-site .nav-link {
        align-items: flex-start;
        text-align: left;
    }
}

/* ---------- Pages internes : menu agence ---------- */
.sidebar-agence {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100vh;
    z-index: 1070;
    background: var(--shell-bg);
    border-left: 1px solid var(--shell-border);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
}

body.agence-open .sidebar-agence {
    transform: translateX(0);
    visibility: visible;
}

.sidebar-agence-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1065;
}

body.agence-open .sidebar-agence-overlay {
    display: block;
}

body.agence-open {
    overflow: hidden;
}

.sidebar-agence-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.sidebar-agence-brand {
    display: block;
    font-weight: 800;
    color: var(--shell-text-strong);
    letter-spacing: 1px;
}

.sidebar-agence-tagline {
    display: block;
    font-size: 0.85rem;
    color: var(--shell-text);
}

.sidebar-agence-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--shell-text-strong);
    font-size: 1.15rem;
}

.sidebar-agence-user {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--shell-border);
}

.sidebar-agence-whoami {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--shell-hover);
    color: var(--shell-text-strong);
}

.sidebar-agence-whoami i {
    font-size: 1.5rem;
    color: var(--gold);
}

.sidebar-agence-whoami small {
    display: block;
    color: var(--shell-text);
}

.btn-agence {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease;
}

.btn-agence-primary {
    background: var(--gold);
    color: var(--on-gold);
}

.btn-agence-primary:hover {
    background: var(--gold-light);
    color: #020617;
}

.btn-agence-outline {
    border: 1px solid var(--gold);
    color: var(--gold);
}

.btn-agence-outline:hover {
    background: var(--shell-hover);
    color: var(--gold);
}

.sidebar-agence-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex-grow: 1;
}

.sidebar-agence-nav a {
    color: var(--shell-text-strong);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.55rem 0.25rem;
}

.sidebar-agence-nav a span {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--shell-text);
}

.sidebar-agence-nav a:hover {
    color: var(--gold);
}

.sidebar-agence-nav hr {
    border-color: var(--shell-border);
    opacity: 1;
    margin: 0.75rem 0;
}

/* ---------- Blocs hérités de l'ancien thème blanc ----------
   Beaucoup de pages (légal, catalogue, formations, blog, outils) contiennent des sections
   bg-white / bg-light et des textes text-dark écrits pour un fond blanc. En thème sombre,
   on les passe sur les surfaces sombres pour que le texte clair reste lisible. */
:root:not([data-theme="light"]) .bg-white {
    background-color: var(--content-surface) !important;
}

:root:not([data-theme="light"]) .text-dark:not(.btn-warning):not(.bg-warning),
:root:not([data-theme="light"]) .link-dark,
:root:not([data-theme="light"]) .text-black {
    color: var(--content-heading) !important;
}

:root:not([data-theme="light"]) .card {
    --bs-card-bg: var(--content-surface);
    --bs-card-border-color: var(--content-border);
    --bs-card-cap-bg: rgba(255, 255, 255, 0.03);
    color: var(--content-text);
}

/* Boutons et badges sur fond jaune / cyan / or : texte foncé */
.badge.bg-warning:not(.bg-opacity-10),
.badge.bg-info:not(.bg-opacity-10),
.btn.btn-warning,
.bg-warning:not(.bg-opacity-10) > h5,
.badge.bg-gold-gradient {
    color: #111827 !important;
}

.text-gold-dim {
    color: var(--gold-dim) !important;
}

/* ---------- Pied de page ---------- */
.footer-premium {
    background: var(--footer-bg);
    border-top: 1px solid rgba(var(--gold-rgb), 0.1);
    position: relative;
    z-index: 1;
    padding: 3rem 0 1.5rem;
    margin: 0;
}

.footer-premium .container {
    position: relative;
}

.footer-brand-text {
    color: var(--shell-text);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.footer-heading {
    color: var(--gold);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.25rem;
}

.footer-link {
    color: var(--shell-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s, transform 0.25s;
    display: inline-block;
    margin-bottom: 0.7rem;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--shell-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s;
}

.footer-social-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(var(--gold-rgb), 0.35);
    color: var(--gold);
    font-size: 1rem;
    transition: background 0.25s, color 0.25s;
}

.footer-social-link:hover {
    color: var(--gold);
}

.footer-social-link:hover i {
    background: var(--gold);
    color: var(--on-gold);
}

.footer-sep {
    width: 2.5rem;
    height: 1px;
    margin: 0.3rem 0 1rem;
    background: var(--shell-border);
}

.footer-link:hover {
    color: var(--gold);
    transform: translateX(4px);
}

.footer-contact {
    color: var(--shell-text);
    font-size: 0.9rem;
}

.footer-contact a {
    color: var(--shell-text);
    text-decoration: none;
}

.footer-contact a:hover {
    color: var(--gold);
}

.footer-newsletter-form .form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(var(--gold-rgb), 0.2);
    color: var(--shell-text-strong);
    padding: 12px 18px;
    font-size: 0.9rem;
    border-radius: 8px 0 0 8px;
}

.footer-newsletter-form .form-control::placeholder {
    color: var(--shell-text);
}

.footer-newsletter-form .form-control:focus {
    border-color: var(--gold);
    box-shadow: none;
}

.footer-newsletter-form .btn-newsletter {
    background: var(--gold);
    color: var(--on-gold);
    border-radius: 0 8px 8px 0;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 0 22px;
    border: none;
}

.footer-newsletter-form .btn-newsletter:hover {
    background: var(--gold-light);
}

.footer-newsletter-message {
    font-size: 0.85rem;
    margin-top: 0.6rem;
    min-height: 1.2em;
}

.footer-newsletter-message.ok { color: #34d399; }
.footer-newsletter-message.error { color: #f87171; }

.footer-small {
    color: var(--shell-text);
    opacity: 0.6;
    font-size: 0.75rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2.5rem;
    padding-top: 1.25rem;
}

.footer-legal-link {
    color: var(--shell-text);
    text-decoration: none;
    font-size: 0.78rem;
}

.footer-legal-link:hover { color: var(--gold); }

/* ---------- Fil d'Ariane ---------- */
.breadcrumb-wrapper {
    background: transparent;
    border-bottom: 1px solid var(--shell-border);
}

.breadcrumb-wrapper .breadcrumb-item a,
.breadcrumb-wrapper .breadcrumb-item.active,
.breadcrumb-wrapper .breadcrumb-item + .breadcrumb-item::before {
    color: var(--shell-text);
}

.breadcrumb-wrapper .breadcrumb-item a:hover {
    color: var(--gold);
}

/* ---------- Chatbot aux couleurs de la marque ---------- */
#chatbot-button {
    background: var(--gold);
    color: var(--on-gold);
    box-shadow: 0 4px 14px rgba(var(--gold-rgb), 0.45);
}

#chatbot-header,
.chat-message.user .message-content,
#chatbot-send {
    background: #020617;
}

#chatbot-header h5 {
    color: var(--gold);
}

@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 40px);
        height: 70vh;
    }
}

/* ---------- Espacements « 6 » utilisés par les pages (absents de Bootstrap, qui s'arrête à 5) ;
   sans !important pour laisser primer les marges écrites dans la page ---------- */
.mb-6 { margin-bottom: 4.5rem; }
.my-6 { margin-top: 4.5rem; margin-bottom: 4.5rem; }
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }

@media (max-width: 767.98px) {
    .mb-6 { margin-bottom: 3rem; }
    .my-6 { margin-top: 3rem; margin-bottom: 3rem; }
    .py-6 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}

/* ---------- Bandeaux de page partagés ----------
   .services-hero (Services, Solutions) : titre centré.
   .page-hero.hero-blog (Blog, Outils, Support) : titre à gauche, grande icône à droite.
   Repris ici pour que toutes les pages qui les utilisent aient le même rendu. */
.services-hero {
    margin-top: 0 !important;
    padding-top: 120px !important;
}

.page-hero {
    margin-top: 0 !important;
    padding-top: 120px !important;
}

.page-hero.hero-blog {
    min-height: 350px;
    padding: 100px 0 60px 0;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .services-hero {
        padding-top: 100px !important;
    }

    .page-hero.hero-blog {
        min-height: 300px;
        padding: 80px 0 40px 0;
    }

    .page-hero h1 {
        font-size: 2rem !important;
    }
}

/* ---------- Chatbot : actions rapides et réservation ---------- */
#chatbot-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    overflow-x: auto;
}
#chatbot-actions button,
#chatbot-actions a {
    flex-shrink: 0;
    border: 1px solid rgba(var(--gold-rgb), 0.5);
    background: #fff;
    color: #020617;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
#chatbot-actions button:hover,
#chatbot-actions a:hover { background: rgba(var(--gold-rgb), 0.15); }
.chat-message .message-content a { color: #1d4ed8; text-decoration: underline; }
.chat-booking { max-width: 90% !important; }
.chat-booking form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.chat-booking select,
.chat-booking input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 13px;
    background: #fff;
    color: #111827;
}
.chat-booking button {
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-weight: 700;
    background: var(--gold);
    color: var(--on-gold);
}
.chat-booking-error { color: #b91c1c; font-size: 12px; margin: 0; }
