/* ==========================================================
   CHARTE GRAPHIQUE BNIC - STYLE GÉNÉRAL
   Couleurs : Bleu Marine (#002349), Or (#c5a059)
   Polices : Playfair Display (Headings), Montserrat (Brand),
             Poppins (Body), Inter (UI)
   ========================================================== */

:root {
    --primary-color: #002349; /* Marine BNIC */
    --secondary-color: #c5a059; /* Or BNIC */
    --accent-color: #0d6efd; /* Bleu éclat pour liens */
    --light-bg: #f4f7f9;
    --white: #ffffff;
    --whatsapp-color: #25d366;
    --danger: #dc3545;
    
    /* Polices gratuites Google Fonts */
    --font-heading: 'Playfair Display', serif;
    --font-brand: 'Montserrat', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

* {
    font-family: var(--font-body);
}

html {
    font-family: var(--font-body);
}

body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- HEADINGS & TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary-color);
}

h1 { font-size: 2.5rem; letter-spacing: -1px; }
h2 { font-size: 2rem; letter-spacing: -0.8px; }
h3 { font-size: 1.5rem; letter-spacing: -0.5px; }
h4 { font-family: var(--font-brand); font-size: 1.25rem; letter-spacing: 0.5px; }
h5 { font-family: var(--font-brand); font-size: 1.1rem; }
h6 { font-family: var(--font-brand); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.8px; }

.text-muted {
    font-family: var(--font-ui);
    font-size: 0.9rem;
}

/* --- GLOBAL TYPOGRAPHY FOR ALL ELEMENTS --- */
p, span, a, li, div, td, th {
    font-family: var(--font-body);
}

form, input, textarea, select, button, label {
    font-family: var(--font-ui) !important;
}

small, .small {
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

strong, .fw-bold, b {
    font-family: var(--font-brand);
    font-weight: 700;
}

/* --- GLOBAL PARAGRAPH STYLING --- */
p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

code, pre, .code {
    font-family: 'Courier New', monospace;
}

/* --- NAVBAR MODERNISÉE --- */
.navbar {
    background-color: var(--white) !important; /* Fond blanc pour faire ressortir le logo */
    border-bottom: 2px solid var(--primary-color);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-family: var(--font-brand);
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.6rem;
}

.navbar-brand span {
    color: var(--secondary-color);
}

.nav-link {
    font-family: var(--font-ui);
    font-weight: 500;
    color: var(--primary-color) !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}

/* --- SYSTÈME DE NOTIFICATIONS (CLOCHE) --- */
.nav-link-notif {
    position: relative;
    padding: 8px;
    color: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-link-notif:hover {
    transform: scale(1.1);
}

.notif-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    border: 2px solid white;
    font-weight: bold;
}

.notif-dropdown {
    width: 350px;
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
    border-radius: 12px !important;
}

.notif-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 15px;
    border-radius: 12px 12px 0 0;
}

.notif-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: block;
    text-decoration: none !important;
    color: #444 !important;
    transition: background 0.2s;
    cursor: pointer;
}

.notif-item:hover {
    background-color: #f8f9fa;
}

.notif-item.unread {
    background-color: #f0f4ff;
    border-left: 4px solid var(--secondary-color);
}

.notif-msg {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 3px;
}

.notif-time {
    font-size: 0.75rem;
    color: #999;
}

.notif-scroll {
    max-height: 230px !important;
    overflow-y: auto !important;
}

/* --- ALERTES FLASH --- */
.alert-flash {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- BOUTONS --- */
.btn {
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: capitalize;
}

.btn-primary, .btn-navy {
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 35, 73, 0.2);
}

.btn-primary:hover, .btn-navy:hover {
    background-color: #001a35;
    color: var(--secondary-color);
    box-shadow: 0 8px 20px rgba(0, 35, 73, 0.3);
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.2);
}

.btn-warning:hover {
    background-color: #d4b566;
    border-color: #d4b566;
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.3);
    transform: translateY(-2px);
}

.btn-outline-primary, .btn-outline-light {
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.btn-lg {
    font-size: 1.1rem;
    padding: 0.7rem 1.5rem;
}

/* --- CARTES ET SECTIONS --- */
.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    border-radius: 15px 15px 0 0;
    border: none;
}

.card-title {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
}

.card-text {
    font-family: var(--font-body);
    color: #555;
    line-height: 1.6;
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-top: 5px solid var(--secondary-color);
    height: 100%;
}

.testimonial-card .card-title {
    font-family: var(--font-brand);
    font-size: 1.1rem;
}

/* --- WHATSAPP FLOATING BUTTON --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--whatsapp-color);
    color: white !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.15) rotate(10deg);
    background-color: #128c7e;
}

/* --- BARRE DE SCROLL PERSONNALISÉE --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive: reposition notifications dropdown for small screens */
@media (max-width: 767.98px) {
    .notif-dropdown, .notif-dropdown.mobile {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        top: 56px !important; /* juste sous la navbar sticky */
        width: calc(100% - 16px) !important;
        border-radius: 10px !important;
        max-height: calc(100vh - 120px) !important;
        overflow: visible !important;
        box-shadow: 0 8px 30px rgba(0,0,0,0.18) !important;
        transform: none !important;
    }

    .notif-badge {
        right: 8px;
        top: 6px;
    }

    .alert-flash {
        right: 8px;
        left: 8px;
        min-width: unset;
    }
}

/* Mobile open animation for notifications */
@keyframes notifSlideDown {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.notif-dropdown.mobile-open {
    animation: notifSlideDown 220ms ease-out both;
}

/* ==========================================================
   DARK MODE OVERRIDES
   Force default text to be readable (white) when user prefers
   a dark color scheme. Leave explicitly colored elements
   (like `.text-primary`, `.text-warning`) untouched where
   they set a different color; override `.text-dark` here.
   ========================================================== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0b1116 !important;
        color: #ffffff !important;
    }

    /* Make the default text elements white so they remain visible */
    p, span, a, li, div, td, th, .card-text, .card-title, .navbar-brand, .nav-link, .lead, small, .small {
        color: #ffffff !important;
    }

    /* Many templates use the Bootstrap utility `.text-dark` — in dark mode
       this would make text invisible. Override it to show white instead. */
    .text-dark {
        color: #ffffff !important;
    }

    /* Keep links and interactive elements distinguishable */
    a, .nav-link, .btn-link {
        color: var(--accent-color) !important;
    }

    /* Cards and other surfaces should be dark but distinct from body */
    .card {
        background-color: #0f1720 !important;
        border-color: rgba(255,255,255,0.06) !important;
        color: #ffffff !important;
    }
}

/* Slightly dim background when mobile notifications open (optional overlay) */
.notif-overlay { display: none; }
@media (max-width: 767.98px) {
    .notif-overlay.show {
        display: block;
        position: fixed;
        left: 0; right: 0; top: 0; bottom: 0;
        background: rgba(0,0,0,0.28);
        z-index: 1050;
    }
}

/* Overlay transition and mobile button */
.notif-overlay {
    opacity: 0;
    transition: opacity 180ms ease;
}
.notif-overlay.show {
    opacity: 1;
}

#markAllMobile {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 1060;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

@media (max-width: 767.98px) {
    #markAllMobile { display: inline-block; }
}

/* Pulse animation for unread notifications */
@keyframes notifPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,53,69, 0.12); }
    60% { transform: scale(1.02); box-shadow: 0 8px 18px 4px rgba(220,53,69, 0.08); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,53,69, 0); }
}

.nav-link-notif.pulse { animation: notifPulse 2.2s ease-in-out infinite; }
.notif-badge.pulse { animation: notifPulse 2.2s ease-in-out infinite; }

/* --- Animation globale douce pour les sections et boutons --- */
.soft-reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.6s ease, transform 0.6s ease; }
.soft-reveal.visible { opacity: 1; transform: none; }

/* Small hover lift for interactive cards */
.hover-lift { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(0,0,0,0.12); }

/* Utility to quickly apply a subtle gradient background */
.bg-subtle-gradient { background-image: linear-gradient(90deg, rgba(2,40,73,0.03), rgba(197,160,89,0.03)); }

/* ===== FOOTER STYLING (COMPACTÉ & ÉLÉGANT) ===== */
footer.footer-elegance {
    font-family: var(--font-body);
    background: linear-gradient(135deg, rgba(0, 35, 73, 0.98), rgba(0, 26, 56, 0.98)) !important;
    border-top: 3px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

footer.footer-elegance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

footer.footer-elegance h5 {
    font-family: var(--font-brand);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 0.75rem !important;
    transition: all 0.3s ease;
}

footer.footer-elegance h5:hover {
    color: white !important;
    transform: translateX(2px);
}

footer.footer-elegance p {
    font-family: var(--font-body);
    line-height: 1.5;
    margin: 0;
}

footer.footer-elegance .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: color 0.3s ease;
}

footer.footer-elegance .hover-link {
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

footer.footer-elegance .hover-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

footer.footer-elegance .hover-link:hover {
    color: #ffffff !important;
}

footer.footer-elegance .hover-link:hover::after {
    width: 100%;
}

footer.footer-elegance .footer-icon {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    font-size: 1.5rem;
    display: inline-block;
}

footer.footer-elegance .footer-icon:hover {
    transform: translateY(-3px) scale(1.2);
    filter: drop-shadow(0 4px 12px rgba(197, 160, 89, 0.4));
}

footer.footer-elegance hr {
    border-color: rgba(197, 160, 89, 0.2) !important;
    margin: 0.5rem 0 !important;
}

footer.footer-elegance .newsletter-input {
    font-family: var(--font-ui);
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(197, 160, 89, 0.4) !important;
    color: white !important;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem !important;
}

footer.footer-elegance .newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

footer.footer-elegance .newsletter-input:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--secondary-color) !important;
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15) !important;
}

footer.footer-elegance .newsletter-btn {
    font-family: var(--font-ui);
    font-weight: 700;
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem !important;
}

footer.footer-elegance .newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.4) !important;
    background: #d4b566 !important;
    border-color: #d4b566 !important;
}

/* ===== CARROUSEL BOOTSTRAP 20 IMAGES ===== */

.carousel-img {
    object-fit: cover;
    object-position: center;
    height: auto;
    max-height: 600px;
    width: 100%;
    display: block;
}

.carousel {
    border: 1px solid var(--secondary-color);
    background: #f8f9fa;
}

.carousel-indicators {
    bottom: -50px;
    padding-top: 10px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.carousel-indicators [data-bs-target].active {
    background-color: var(--secondary-color);
    opacity: 1;
    transform: scale(1.3);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--color-primary);
    border-radius: 50%;
    padding: 10px;
}

.carousel-caption {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    padding: 20px;
    bottom: 0;
}

.carousel-caption h5 {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
}

/* Boutons superposés sur le carrousel */
.carousel .btn {
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.95);
}

.carousel .btn-success {
    background: rgba(25, 135, 84, 0.9) !important;
    border-color: rgba(25, 135, 84, 0.9) !important;
    color: white !important;
}

.carousel .btn-success:hover {
    background: #198754 !important;
    transform: translateY(-3px);
}

.carousel .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

footer.footer-elegance .footer-heading {
    position: relative;
    padding-bottom: 0.5rem;
}

footer.footer-elegance .footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--secondary-color);
}

/* Copyright section */
footer.footer-elegance .row.align-items-center {
    padding-top: 0.5rem;
}

footer.footer-elegance .row.align-items-center p {
    font-family: var(--font-ui);
    font-size: 0.8rem;
}

footer.footer-elegance .fw-bold {
    font-family: var(--font-brand);
    font-weight: 700;
    letter-spacing: 0.5px;
}