/* ===================================
   NAVIGATION AVEC DROPDOWNS
   =================================== */

/* Dropdown Container */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Toggle */
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 0;
}

.nav-dropdown-toggle i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

/* Dropdown Menu */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    /* Réduit de 15px à 5px pour faciliter le hover */
    left: 0;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    /* Réduit de 0.3s à 0.2s pour réactivité */
    z-index: 2000;
    pointer-events: none;
}

/* Pont invisible pour faciliter le hover */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    /* Zone invisible pour maintenir le hover */
    z-index: 1999;
}

/* Show Dropdown on Hover */
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown:hover .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

/* Dropdown Menu Links */
.nav-dropdown-menu a {
    display: block;
    padding: 14px 20px;
    /* Augmenté de 12px à 14px pour zone cliquable plus grande */
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    /* Réduit pour réactivité */
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.nav-dropdown-menu a:last-child {
    border-bottom: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(59, 130, 246, 0.15);
    /* Augmenté de 0.1 à 0.15 pour meilleur feedback visuel */
    color: #3b82f6;
    padding-left: 25px;
}

/* Maintenir le dropdown ouvert quand on survole le menu */
.nav-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Status Badge Styling */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* BOUTON BASCULE MODE */
.mode-switch-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-left: 15px !important;
}

.mode-switch-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, #059669, #047857) !important;
}

/* ===================================
   MOBILE MENU TOGGLE
   =================================== */

/* Menu Toggle Button (Hidden by default on desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1100;
    margin-left: 15px;
    padding: 5px;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    color: #3b82f6;
}

/* ===================================
   RESPONSIVE NAVIGATION
   =================================== */

/* ===================================
   STICKY HEADER (STANDARD - GLOBAL)
   =================================== */
.navbar-pro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Reduced from 75px */
    z-index: 1000;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 40px;
    display: flex;
    justify-content: center; /* Centered layout */
    align-items: center;
    transition: all 0.3s ease;
    gap: 30px;
}

@media (max-width: 1024px) {
    .navbar-pro {
        left: 0;
        width: 100%;
    }
}

/* ===================================
   GLOBAL SEARCH BAR
   =================================== */
.nav-search {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
    margin: 0 20px;
}

.nav-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 15px 10px 45px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.nav-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    max-width: 500px;
}

.nav-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.3s;
}

.nav-search-input:focus+.nav-search-icon {
    color: #3b82f6;
}

/* Results Dropdown (Simulation) */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 2100;
}

.search-results.active {
    display: flex;
}

.search-item {
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.search-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: white;
    padding-left: 25px;
}

.search-item i {
    width: 16px;
    text-align: center;
}

@media (max-width: 1100px) {
    .nav-search {
        max-width: 250px;
    }
}

@media (max-width: 1024px) {
    .nav-search {
        max-width: 180px;
        margin: 0 10px;
    }
    .nav-pillars {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 40px;
        transition: right 0.3s ease;
        display: flex !important;
        overflow-y: auto;
    }
    .nav-pillars.active {
        right: 0;
    }
    .pillar-item {
        width: 100%;
        margin-bottom: 20px;
    }
    .mega-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        display: none;
        transform: none;
        border: none;
        background: rgba(255,255,255,0.03);
        box-shadow: none;
        padding-left: 20px;
    }
    .pillar-item:hover .mega-dropdown {
        display: block;
    }
}

/* ===================================
   RESPONSIVE NAVIGATION
   =================================== */
@media (max-width: 1024px) {
    .nav-links-pro {
        gap: 15px;
    }

    .nav-dropdown-menu {
        min-width: 180px;
    }

    .navbar-pro {
        padding: 0 20px;
    }

    /* Afficher le bouton menu */
    .mobile-menu-toggle {
        display: block;
    }

    /* Transformer les liens en tiroir latéral */
    .nav-links-pro,
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 100px 30px 40px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        gap: 25px;
        z-index: 1000;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        display: flex !important;
        /* Force flex display when mobile, will be hidden by right: -100% */
    }

    .nav-links-pro.active,
    .nav-links.active {
        right: 0;
    }

    /* Style des liens dans le menu mobile */
    .nav-links-pro a,
    .nav-links a {
        font-size: 1.1rem;
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: block !important;
    }

    .nav-links-pro a:last-child,
    .nav-links a:last-child {
        border-bottom: none;
    }

    /* Gestion des Dropdowns en Mobile */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255, 255, 255, 0.03);
        margin-top: 5px;
        display: none;
        box-shadow: none;
        border: none;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
    }

    /* Cacher les éléments non essentiels de la nav mobile */
    .nav-language,
    .nav-status {
        display: none;
    }
}

@media (max-width: 768px) {

    .nav-links-pro a,
    .nav-dropdown-toggle {
        font-size: 0.9rem;
    }

    .nav-dropdown-menu {
        min-width: 150px;
    }

    .nav-dropdown-menu a {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
}

/* ===================================
   PROGRESS BAR & ACTIVE STATES (AUDIT FIX)
   =================================== */
.progress-bar-container {
    position: fixed;
    top: 60px; /* Aligned with new 60px height */
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 999;
    pointer-events: none;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #a855f7);
    width: 0%;
    transition: width 0.1s;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Active Section Highlight in Dropdown */
/* ===================================
   WEB3 WALLET CONNECT
   =================================== */
.btn-connect-wallet {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.btn-connect-wallet:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2));
    border-color: #3b82f6;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-connect-wallet.connected {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* Modal Styles */
.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wallet-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.wallet-modal {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallet-modal-overlay.active .wallet-modal {
    transform: scale(1);
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.wallet-header h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.wallet-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.wallet-close:hover {
    color: white;
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-option:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: translateX(5px);
}

.wallet-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.wallet-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 16px;
}

.wallet-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 4px;
}

.wallet-status {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #94a3b8;
    min-height: 20px;
}

/* ===================================
   GUIDE LAYOUT (DESKTOP SIDEBAR) - PREMIUM
   =================================== */

/* MOBILE FIRST: Hidden by default to prevent "gap" issues */
.toc-sidebar {
    display: none;
}

.guide-layout {
    display: block;
}

/* DESKTOP: Show and Style */
@media (min-width: 1100px) {
    .guide-container {
        max-width: 1600px;
        margin: 0 auto;
    }

    .guide-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 80px;
        padding: 60px 40px;
        position: relative;
    }

    /* Full-height vertical divider for the sidebar */
    .guide-layout::before {
        content: '';
        position: absolute;
        top: 0; bottom: 0;
        left: 310px; /* 260px width + partial gap */
        width: 1px;
        background: linear-gradient(to bottom, 
            rgba(255,255,255,0) 0%, 
            rgba(255,255,255,0.08) 10%, 
            rgba(255,255,255,0.08) 90%, 
            rgba(255,255,255,0) 100%
        );
        z-index: 1;
    }

    .toc-sidebar {
        display: block;
        position: sticky;
        top: 100px;
        height: calc(100vh - 140px);
        overflow-y: auto;
        padding-right: 25px;
        scrollbar-width: thin;
        scrollbar-color: rgba(59, 130, 246, 0.2) transparent;
        font-family: 'Inter', system-ui, -apple-system, sans-serif;
        z-index: 10;
    }

    .toc-sidebar::-webkit-scrollbar {
        width: 3px;
    }

    .toc-sidebar::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.2);
        border-radius: 4px;
    }

    .toc-sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
        position: relative;
    }

    .toc-sidebar ul::before {
        content: '';
        position: absolute;
        left: 0;
        top: 10px;
        bottom: 10px;
        width: 1px;
        background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.05) 10%, rgba(255, 255, 255, 0.05) 90%, transparent);
    }

    .toc-sidebar li {
        margin-bottom: 4px;
        position: relative;
    }

    .toc-sidebar a {
        display: flex;
        align-items: center;
        padding: 8px 0 8px 24px;
        color: #64748b;
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        border-left: 2px solid transparent;
        margin-left: -1px;
        transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        position: relative;
    }

    .toc-sidebar a:hover {
        color: #e2e8f0;
        border-left-color: #475569;
        transform: translateX(4px);
    }

    .toc-sidebar a.active {
        color: #3b82f6;
        border-left-color: #3b82f6;
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, transparent 100%);
        box-shadow: inset 1px 0 0 #3b82f6;
        font-weight: 600;
        padding-left: 28px;
    }

    .toc-category {
        font-size: 0.7rem;
        text-transform: uppercase;
        color: #94a3b8;
        font-weight: 900;
        margin-top: 40px;
        margin-bottom: 20px;
        letter-spacing: 0.1em;
        padding-left: 24px;
        display: flex;
        align-items: center;
        gap: 10px;
        opacity: 0.8;
    }

    .toc-category::before {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        background: #3b82f6;
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }

    .guide-content {
        min-width: 0;
    }

}

/* ===================================
   CRITICAL LAYOUT FIX (DESKTOP)
   =================================== */
/* Enforce Grid Layout to prevent Sidebar Overlap */
@media (min-width: 1100px) {
    .guide-container .guide-layout {
        display: grid !important;
        grid-template-columns: 260px minmax(0, 1fr) !important;
        gap: 40px !important;
        padding-left: 20px;
        padding-right: 20px;
        align-items: start;
        /* Prevent full height stretching if not needed */
    }

    .guide-container .toc-sidebar {
        grid-column: 1;
        width: 260px !important;
        min-width: 260px !important;
        position: sticky !important;
        top: 120px !important;
        display: block !important;
        height: calc(100vh - 160px);
        overscroll-behavior: contain;
        z-index: 10;
        /* Ensure sidebar is above if overlap happens, but grid should prevent it */
    }

    /* UNIVERSAL CONTENT FIX:
       Target .guide-content AND any section/div that might have escaped it.
       Force them all into Column 2.
    */
    .guide-container .guide-layout>.guide-content,
    .guide-container .guide-layout>section,
    .guide-container .guide-layout>div:not(.toc-sidebar) {
        grid-column: 2 !important;
        min-width: 0 !important;
        width: 100% !important;
        margin-left: 0 !important;
        box-sizing: border-box;
    }

    /* Ensure specific containers respect the width */
    .simulator-container,
    .comparison-table,
    .benchmarks-grid,
    .premium-grid-3,
    .table-responsive {
        max-width: 100% !important;
    }
}

/* ===================================
   INSTITUTIONAL NAVIGATION LINKS
   =================================== */

.nav-links-influence {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin-left: auto;
}

.nav-links-influence a {
    text-decoration: none;
    color: #94a3b8; /* Slate 400 - Subtle institutional grey */
    font-family: 'Inter', 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease, transform 0.2s ease;
}

/* Hover State */
.nav-links-influence a:hover {
    color: #f8fafc; /* Slate 50 - High contrast white */
}

/* Underline Animation */
.nav-links-influence a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links-influence a:hover::after {
    width: 100%;
}

/* Active State */
.nav-links-influence a.active {
    color: #3b82f6; /* Azure Blue */
}

.nav-links-influence a.active::after {
    width: 100%;
    background: #3b82f6;
}

/* ===================================
   INSTITUTIONAL RESEARCH CARDS
   =================================== */
.inst-research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
    margin: 40px 0;
}

.inst-research-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.inst-research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #a855f7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inst-research-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.inst-research-card:hover::before {
    opacity: 1;
}

.card-category-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #3b82f6;
    font-weight: 800;
    margin-bottom: 20px;
    display: block;
}

.card-research-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    line-height: 1.3;
}

.card-research-desc {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 30px;
    line-height: 1.6;
    flex-grow: 1;
}

.card-research-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.card-research-meta span i {
    margin-right: 6px;
    color: #3b82f6;
}

.card-research-cta {
    margin-top: 25px;
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: gap 0.3s ease;
}

.inst-research-card:hover .card-research-cta {
    gap: 15px;
    color: #3b82f6;
}