/* =========================================
   1. VARIABLES & THEME CONFIGURATION
   ========================================= */

:root {
    /* Primary Colors */
    --c-primary: #4564ff;
    --c-primary-75: rgba(69, 100, 255, 0.75);
    --c-primary-50: rgba(69, 100, 255, 0.5);
    --c-primary-25: rgba(69, 100, 255, 0.25);
    --c-primary-light: #638fff;
    --c-primary-light-50: rgba(99, 143, 255, 0.5);
    --c-primary-light-25: rgba(99, 143, 255, 0.5);
    --c-secondary: #EE8383;

    /* Background Colors */
    --c-bg-white: #FFF;
    --c-bg-white-75: rgba(255, 255, 255, 0.75);
    --c-bg-white-50: rgba(255, 255, 255, 0.5);
    --c-bg-white-25: rgba(255, 255, 255, 0.25);
    --c-label: #e5e5f8;
    --c-display: #9cb8ff;
    --c-body: #f6fbff;
    --c-background: #F8F8F8;
    --c-background-15: rgba(248, 248, 248, 0.15);
    --c-hover: rgb(247, 245, 255);

    /* Layout Variables */
    --sidebar-width: 300px;
    
    /* Hero Banner Variable */
    --hero-bg: #212529;

    /* Status Colors */
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f97316;
    --c-blue-500: var(--c-blue-500);

    /* Typography - system font fallback for fast first paint */
    --st-font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --st-icon-font-family: Font Awesome 6 Free, Font Awesome 5 Free;

    /* Box Shadows */
    --bs-button: 0 4px 8px rgba(142.27, 126.66, 162.56, 0.50);
    --bs-spread: 0px 5px 25px 0px rgba(118, 103, 139, 0.25);
    --bs-spread-light: 0px 5px 25px 0px rgba(118, 103, 139, 0.15);
    --bs-smashed: 0px 2px 2px 0px rgba(142, 127, 163, 0.50);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --t-all: all 300ms ease;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-transform: transform 0.2s ease;
    --transition-card: transform 0.2s ease, box-shadow 0.2s ease;

    /* Bootstrap Primary Color Override */
    --bs-primary: #4564ff;
    --bs-primary-rgb: 69, 100, 255;

    /* Slate Colors (Tailwind) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

/* Dark Mode Configuration */
[data-bs-theme="dark"] {
    /* Colors */
    --c-primary: #638fff;
    --c-primary-75: rgba(99, 143, 255, 0.75);
    
    --c-bg-white: #343a40; /* Harmonized Gray */
    --c-bg-white-75: rgba(52, 58, 64, 0.75);
    --c-bg-white-50: rgba(52, 58, 64, 0.5);
    --c-bg-white-25: rgba(52, 58, 64, 0.25);
    
    --c-label: #495057;
    --c-display: #adb5bd;
    
    --c-body: #f8fafc; /* Light text */
    --c-background: #212529; /* Main Dark Background */
    --c-background-15: rgba(33, 37, 41, 0.15);
    --c-hover: #495057;
    
    /* Hero Banner Dark Mode */
    --hero-bg: linear-gradient(180deg, #4564ff 0%, #2a43cc 100%);
    
    /* Bootstrap Overrides */
    --bs-body-bg: var(--c-background);
    --bs-body-color: var(--c-body);
    --bs-secondary-bg: #343a40;
    --bs-tertiary-bg: #495057;
}

/* =========================================
   2. BASE & BOOTSTRAP OVERRIDES
   ========================================= */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--st-font-family), 'Poppins', sans-serif;
    color: var(--c-body);
    font-size: 14px;
    word-wrap: break-word;
    background: var(--c-background);
}

/* Buttons */
.s-button, .btn {
    text-decoration: none;
    min-width: 5rem;
    padding: .5rem 1rem;
    text-align: center;
    font-size: 1rem;
    font-family: var(--st-font-family);
    font-weight: 500;
    word-wrap: break-word;
    border-radius: var(--radius-full);
    transition: var(--t-all);
    cursor: pointer;
}

.s-button:first-letter, .btn:first-letter {
    text-transform: uppercase;
}

.btn-primary {
    --bs-btn-bg: #4564ff;
    --bs-btn-border-color: #4564ff;
    --bs-btn-hover-bg: #3754cc;
    --bs-btn-hover-border-color: #3754cc;
    --bs-btn-active-bg: #2e47b3;
    --bs-btn-active-border-color: #2e47b3;
}

.btn-outline-primary {
    --bs-btn-color: #4564ff;
    --bs-btn-border-color: #4564ff;
    --bs-btn-hover-bg: #4564ff;
    --bs-btn-hover-border-color: #4564ff;
    --bs-btn-active-bg: #4564ff;
    --bs-btn-active-border-color: #4564ff;
}

/* Inputs */
.s-input, .form-control {
    background: var(--bs-secondary-bg);
}

.s-input:focus, .form-control:focus {
    background: var(--bs-secondary-bg);
    border-color: var(--c-primary-light) !important;
    box-shadow: 0 0 0 0.2rem var(--c-primary-light-25) !important;
}

/* Nav Items */
.nav-link.active {
    background-color: var(--c-primary) !important;
    box-shadow: var(--bs-smashed);
    transition: var(--t-all);
}

.nav-link {
    color: var(--c-primary);
}

.nav-item { 
    transition: var(--t-all);
}

.nav-item:hover {
    background: var(--c-hover);
    color: var(--c-primary) !important;
}

/* Scrollbar */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================================
   3. UTILITIES & GLASSMORPHISM
   ========================================= */

/* Backgrounds */
.bg-white { background: var(--c-bg-white); }
.bg-white-75 { background: var(--c-bg-white-75); }
.bg-white-50 { background: var(--c-bg-white-50); }
.bg-surface { background-color: var(--c-bg-white) !important; }

/* Text Colors */
.tc-body { color: var(--c-body); }
.tc-display { color: var(--c-display); }
.tc-label { color: var(--c-label); }
.tc-primary { color: var(--c-primary); }
.tc-secondary { color: var(--c-secondary); }
.tc-green { color: #28ff56; }
.font-color { color: #625F6F; }

/* Glass Effect - Optimized for performance */
.glass {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    overflow: hidden;
}

.glass-transparent {
    background: transparent !important;
}

/* Pseudo-elements removed for performance - uncomment if needed */
/*
.glass::before {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 200%; height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    pointer-events: none;
}

.glass::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%, rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
}
*/

/* Glass Dark Mode Adaptation */
[data-bs-theme="dark"] .glass {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Zoom Hover Effect */
.zoom-on-hover {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition-delay: 0.25s;
}
.zoom-on-hover:hover {
    transform: scale(1.065);
}

/* Progress Bar */
.progress-bar {
    background: linear-gradient(90deg, #4564ff 0%, #8a9eff 100%);
    box-shadow: inset 0 1px 2px var(--bs-spread)
}

/* Logo Inversion */
[data-bs-theme="dark"] .sidebar-logo-img,
[data-bs-theme="dark"] .navbar-logo {
    filter: invert(1) brightness(200%);
}

/* =========================================
   4. COMPONENTS & LAYOUT (Desktop Default)
   ========================================= */

/* Layout Helpers */
.sidebar-container {
    width: var(--sidebar-width) !important;
}

.layout-main {
    margin-left: var(--sidebar-width) !important;
    transition: margin-left 0.3s ease;
}

/* Hero Banner */
.area-banner {
    background: var(--hero-bg) !important;
}

/* Providers Panel Animation */
.providers-panel-transition {
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease, visibility 0.4s, width 0.4s ease, left 0.4s ease, margin 0.4s ease, bottom 0.4s ease, border-radius 0.4s ease;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.providers-panel-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.providers-panel-transition {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.providers-panel-centered {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 380px;
    max-width: 95%;
    bottom: 1rem;
    border-radius: 1.5rem !important;
}

.providers-panel-expanded {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    height: 85vh !important;
    max-height: 85vh !important;
    bottom: 0 !important;
    border-radius: 2rem 2rem 0 0 !important;
    display: flex;
    flex-direction: column;
}

.providers-panel-centered .search-zone,
.providers-panel-centered #providers-list {
    display: none;
}

.providers-panel-expanded .search-zone {
    display: flex;
}

.providers-panel-expanded #providers-list {
    display: block;
}

.providers-panel-expanded #panel-metadata {
    display: none !important;
}

/* Masquer la recherche globale si le panel est ouvert */
.providers-panel-visible ~ .translate-middle-x {
    display: none !important;
}

/* Animation fluide pour les nouveaux éléments */
#panel-metadata {
    transition: all 0.3s ease;
}

/* Map Zoom Controls (Desktop Position) */
.map-zoom-controls {
    top: 0;
}

/* Category Chips Container (3 rows horizontal scroll on mobile) */
@media (max-width: 991.98px) {
    .category-chips-container {
        flex-direction: column;
        flex-wrap: wrap;
        height: 160px; /* Increased from 140px to fit 3 rows comfortably */
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem !important;
        align-content: flex-start; /* Ensure items start from the left */
    }
    
    .category-chips-container::-webkit-scrollbar {
        display: none;
    }
    
    .category-chips-container .btn {
        white-space: nowrap;
        width: auto;
        flex-shrink: 0;
    }
}

/* Dashboard Layout Base (Mobile Flex Fallback) */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.providers-panel-expanded {
    left: 0;
    right: 0;
    width: 100% !important;
    height: 85vh !important;
    max-height: 85vh !important;
    bottom: 0 !important;
    margin-bottom: 0;
    border-radius: 2rem 2rem 0 0 !important;
    display: flex;
    flex-direction: column;
}

.providers-panel-expanded #providers-list,
.providers-panel-expanded #provider-details {
    max-height: none !important;
    flex: 1;
}

.btn-halo {
    cursor: pointer;
}

.btn-halo:hover {
    border-color: var(--bs-primary);
    background-color: var(--c-primary-25);
}

/* =========================================
   5. RESPONSIVE MEDIA QUERIES
   ========================================= */

/* Mobile & Tablet (< 992px) */
@media (max-width: 991.98px) {
    /* Reset Sidebar Width on Mobile */
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar-container {
        padding: 0 !important;
        width: 300px !important;
    }

    .sidebar-content {
        border-radius: 0 !important;
    }
    
    .layout-main {
        margin-left: 0 !important;
    }

    /* Map Zoom Controls Mobile Position */
    .map-zoom-controls {
        top: auto !important;
        bottom: 20px !important;
    }
    
    /* Dashboard Mobile Layout Order */
    .area-header { order: 0; }
    .area-products { order: 1; }
    .area-banner { 
        order: 2; 
        min-height: 400px; 
        display: flex; 
        flex-direction: column; 
    }
    .area-bp { order: 3; }
    .area-ebooks { order: 4; }
    .area-map { order: 5; height: 400px; }
    
    /* Ebooks Grid Mobile */
    /* Slider handled in template with d-flex for better stability */

    .bg-power-box {
        transform: scale(0.5);
        transform-origin: bottom right;
        bottom: -150px !important;
        right: -150px !important;
   }

    .bg-power-eclair {
        top: -350px !important;
        right: -350px !important;
   }
}

/* Desktop (>= 992px) */
@media (min-width: 992px) {
    /* Dashboard Grid Layout */
    .dashboard-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .area-header { grid-column: 1 / -1; }
    .area-banner { grid-column: 1 / -1; min-height: auto; }
    .area-products { grid-column: 1 / -1; }
    .area-map { grid-column: span 1; height: auto; min-height: 320px; }
    .area-bp { grid-column: span 1; min-height: 320px; }
    .area-ebooks { grid-column: 1 / -1; }
}

/* =========================================
   7. QA POPUP & MODAL
   ========================================= */

/* Petit popup discret */
.qa-nudge{
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2000;
}
.qa-nudge__card{
    width: min(360px, calc(100vw - 36px));
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    box-shadow: 0 18px 55px rgba(0,0,0,.18);
    overflow: hidden;
}
.qa-nudge__head{
    display:flex; align-items:center; justify-content:space-between;
    gap:12px; padding: 12px 12px;
    background: linear-gradient(135deg, rgba(108,77,255,.10), rgba(143,107,255,.08));
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.qa-nudge__badge{
    font-size: 11px; font-weight: 900; letter-spacing:.08em;
    color:#6C4DFF; text-transform:uppercase;
}
.qa-nudge__dismiss{
    border:none; background: rgba(0,0,0,.06);
    width:34px; height:34px; border-radius: 12px; cursor:pointer;
}
.qa-nudge__body{ padding: 12px; }
.qa-nudge__q{
    margin: 0 0 10px;
    font-weight: 900;
    color: #0b1220;
    line-height: 1.25;
}
.qa-nudge__btn{
    width: 100%;
    background: linear-gradient(135deg, #6C4DFF, #8F6BFF);
    border: none;
    color: #fff;
    font-weight: 800;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 10px 25px rgba(108,77,255,.35);
    cursor:pointer;
}

/* container global */
.qa-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.qa-modal.is-open {
    display: block;
}

/* overlay */
.qa-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,14,25,.35);
    backdrop-filter: blur(4px);
}

/* === LE CHAT À DROITE === */
.qa-modal__panel {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;

    width: min(420px, calc(100vw - 24px));
    background: rgba(255,255,255,.96);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    animation: slideInRight 0.2s ease-out;
}

/* animation douce */
@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0.6;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* header */
.qa-modal__header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* body scrollable */
.qa-modal__body {
    flex: 1;
    padding: 14px 16px;
    overflow-y: auto;
}

/* footer */
.qa-modal__footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.85);
}

/* bulles chat */
.qa-msg{ display:flex; margin: 10px 0; }
.qa-msg.user{ justify-content:flex-end; }
.qa-bubble{
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 14px;
    line-height: 1.6;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,.06);
    background: rgba(0,0,0,.03);
    color:#0b1220;
    white-space: pre-wrap;
}
.qa-msg.user .qa-bubble{
    background: linear-gradient(135deg, rgba(108,77,255,.18), rgba(143,107,255,.14));
    border-color: rgba(108,77,255,.22);
}
/* Croix stylée */
.qa-close{
    border: none;
    background: rgba(0,0,0,.06);
    width: 40px;
    height: 40px;
    border-radius: 14px;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: background .15s ease, transform .15s ease;
}

.qa-close i{
    font-size: 16px;
    color: #0b1220;
    opacity: .7;
}

.qa-close:hover{
    background: rgba(108,77,255,.15);
    transform: scale(1.05);
}

.qa-close:hover i{
    color: #6C4DFF;
    opacity: 1;
}

.qa-close:active{
    transform: scale(.96);
}
/* Forcer le texte important en noir */
.qa-title{
    color: #0b1220 !important;
    background: none !important;
}

.qa-meta{
    color: rgba(11,18,32,.65) !important;
    background: none !important;
}

/* ===================================
   AI ANALYSIS PANEL STYLES (Restored & Themed)
   =================================== */

.ai-panel {
    width: 480px !important;
    border: none;
    background: transparent;
}

.ai-panel-inner {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: var(--radius-lg);
    margin: 1rem;
    padding: 0; /* On déplace le padding dans le scrollable */
    height: calc(100vh - 2rem);
    position: relative;
    overflow: hidden; /* Fixe tout ce qui n'est pas dans le scrollable */
    box-shadow: var(--shadow-lg);
}

.ai-panel-scrollable {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    z-index: 2; /* Devant l'image */
}

.ai-panel-close {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--bs-body-color);
    opacity: 0.5;
    cursor: pointer;
    z-index: 10; /* Toujours visible et fixe */
    transition: opacity 0.2s ease;
}

.ai-panel-close:hover {
    opacity: 1;
}

.ai-panel-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
}

.ai-panel-company {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.ai-panel-meta {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin: 0;
}

.ai-panel-meta a {
    color: var(--c-primary);
    text-decoration: underline;
}

.ai-panel-meta a:hover {
    text-decoration: none;
}

/* AI Badge */
.ai-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.ai-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--c-primary);
    border-radius: 50%;
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* AI Panel Content */
.ai-panel-content {
    padding-bottom: 140px;
}

.ai-section {
    margin-bottom: 1.25rem;
}

.ai-section-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    opacity: 0.8;
    font-style: italic;
    margin-bottom: 0.25rem;
}

.ai-section-value {
    font-size: 0.875rem;
    color: var(--bs-body-color);
    line-height: 1.5;
}

.ai-section-value a {
    color: var(--c-primary);
    text-decoration: underline;
}

/* Decorative Graphic */
.ai-panel-graphic {
    position: absolute;
    bottom: -150px;
    right: -300px;
    width: 600px;
    height: 600px;
    pointer-events: none;
    opacity: 0.4;
    z-index: 1; /* Derrière le contenu scrollable */
}

.ai-panel-graphic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loading State */
.ai-panel-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    padding: 1rem 0;
}

/* Responsive AI Panel */
@media (max-width: 576px) {
    .ai-panel {
        width: 100% !important;
    }

    .ai-panel-inner {
        margin: 0.5rem;
        padding: 1.5rem;
        border-radius: var(--radius-md);
        min-height: calc(100vh - 1rem);
    }

    .ai-panel-graphic {
        width: 150px;
        height: 150px;
    }
}

/* =========================================
   PROVIDERS PAGE - PREMIUM DESIGN
   ========================================= */

/* === CATEGORY SELECT === */
.provider-category-select {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    min-width: 200px;
}

.provider-category-select i {
    color: var(--c-primary);
    font-size: 0.9rem;
}

.provider-category-select select {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-body-color);
    cursor: pointer;
    outline: none;
}

/* === TOOLBAR === */
.provider-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.provider-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    min-width: 300px;
    transition: all 0.2s ease;
}

.provider-search:hover {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(69, 100, 255, 0.1);
}

.provider-search i {
    color: var(--bs-secondary-color);
}

.provider-search span {
    flex: 1;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}

.provider-search kbd {
    background: var(--bs-tertiary-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
}

.provider-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.provider-limit select {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.provider-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.provider-pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.provider-pagination-btn:hover:not(.disabled) {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: white;
}

.provider-pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.provider-pagination-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.provider-pagination-info strong {
    color: var(--bs-body-color);
}

/* === TABLE === */
.provider-table-wrapper {
    background: var(--bs-body-bg);
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

.provider-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.provider-table thead {
    background: var(--bs-tertiary-bg);
}

.provider-table th {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    text-align: left;
    border-bottom: 1px solid var(--bs-border-color);
}


.provider-table tbody tr {
    border-bottom: 1px solid var(--bs-border-color);
    transition: background 0.15s ease;
}

.provider-table tbody tr:last-child {
    border-bottom: none;
}

.provider-table tbody tr:hover {
    background: var(--bs-tertiary-bg);
}

.provider-table td {
    padding: 1rem;
    color: var(--bs-body-color);
}

.provider-td-index {
    color: var(--bs-secondary-color);
    font-weight: 500;
    font-size: 0.85rem;
}

.provider-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    color: white;
    font-size: 0.65rem;
}

.provider-td-name {
    font-weight: 600;
    color: var(--bs-body-color) !important;
}

.provider-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--c-primary);
    text-decoration: none;
    font-weight: 500;
}

.provider-link:hover {
    text-decoration: underline;
}

.provider-link i {
    font-size: 0.7rem;
    opacity: 0.7;
}


.provider-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-ai-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.provider-empty {
    text-align: center;
    padding: 4rem 2rem !important;
    color: var(--bs-secondary-color);
}

.provider-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.4;
}

/* === SEARCH MODAL === */
.provider-modal {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.provider-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.provider-modal-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--c-primary);
    border-radius: 0.75rem;
    color: white;
}

.provider-modal-header h5 {
    flex: 1;
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.provider-modal-close {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.provider-modal-close:hover {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.provider-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.provider-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.provider-modal-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.provider-modal-field input,
.provider-modal-field select {
    padding: 0.75rem 1rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--bs-body-color);
    transition: all 0.15s ease;
}

.provider-modal-field input:focus,
.provider-modal-field select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(69, 100, 255, 0.15);
}

.provider-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    justify-content: flex-end;
}

.provider-modal-btn-primary,
.provider-modal-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.provider-modal-btn-primary {
    background: var(--c-primary);
    color: white;
}

.provider-modal-btn-primary:hover {
    background: #3b54e8;
    transform: translateY(-1px);
}

.provider-modal-btn-secondary {
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
}

.provider-modal-btn-secondary:hover {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* === AI ANALYSIS PANEL (NEW DESIGN) === */
.provider-panel {
    width: 480px !important;
    border: none !important;
    background: transparent !important;
}

.provider-panel-inner {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 2rem);
    margin: 1rem;
    background: var(--bs-body-bg);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.provider-panel-header {
    position: relative;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
    padding: 2rem;
    color: white;
    text-align: center;
}

.provider-panel-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.provider-panel-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.provider-panel-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.provider-panel-ai-dot {
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    animation: provider-panel-pulse 2s ease-in-out infinite;
}

@keyframes provider-panel-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.provider-panel-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.provider-panel-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.provider-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Loading Animation */
.provider-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    gap: 1rem;
}

.provider-panel-loading-animation {
    display: flex;
    gap: 0.5rem;
}

.provider-panel-loading-circle {
    width: 12px;
    height: 12px;
    background: var(--c-primary);
    border-radius: 50%;
    animation: provider-loading-bounce 1.4s ease-in-out infinite;
}

.provider-panel-loading-circle:nth-child(1) { animation-delay: 0s; }
.provider-panel-loading-circle:nth-child(2) { animation-delay: 0.16s; }
.provider-panel-loading-circle:nth-child(3) { animation-delay: 0.32s; }

@keyframes provider-loading-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.provider-panel-loading p {
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 0;
}

.provider-panel-loading span {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.provider-panel-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    color: #ef4444;
}

.provider-panel-error i {
    font-size: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .provider-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .provider-search {
        min-width: 100%;
    }

    .provider-toolbar-actions {
        justify-content: space-between;
    }

    .provider-category-select {
        min-width: 100%;
    }

    .provider-panel {
        width: 100% !important;
    }

    .provider-panel-inner {
        margin: 0.5rem;
        height: calc(100vh - 1rem);
        border-radius: 1rem;
    }
}

/* =========================================
   6. BUSINESS PLAN WIZARD
   ========================================= */

.bp-wizard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.bp-step {
    display: none;
}

.bp-step.active {
    display: block;
}

.bp-subtitle {
    font-size: 1.1rem;
    color: var(--slate-500);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.bp-subtitle strong {
    color: var(--slate-800);
}

.bp-start-btn,
.bp-submit-btn {
    padding: 1rem 2rem;
    background: var(--slate-100);
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    color: var(--slate-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bp-start-btn:hover,
.bp-submit-btn:hover {
    background: var(--slate-200);
}

.bp-step-title {
    font-size: 1rem;
    color: var(--slate-500);
    margin-bottom: 1.5rem;
}

.bp-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.bp-card textarea {
    width: 100%;
    min-height: 150px;
    border: none;
    resize: none;
    font-size: 0.95rem;
    color: var(--slate-600);
    background: transparent;
    font-family: inherit;
    outline: none;
}

.bp-card textarea::placeholder {
    color: var(--slate-400);
}

.bp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.bp-upload-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 1rem;
}

.bp-upload-btn:hover {
    color: var(--slate-500);
}

.bp-next-btn {
    padding: 0.75rem 1.5rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    color: var(--slate-600);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

/* .bp-next-btn:hover {
    background: var(--slate-100);
} */

/* Figures Row */
.bp-figures-row {
    display: flex;
    gap: 1rem;
}

.bp-figure {
    flex: 1;
}

.bp-figure label {
    display: block;
    font-size: 0.75rem;
    color: var(--slate-400);
    margin-bottom: 0.5rem;
}

.bp-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bp-input-group input {
    flex: 1;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid var(--slate-200);
    font-size: 1.25rem;
    color: var(--slate-800);
    background: transparent;
    outline: none;
    width: 100%;
}

.bp-input-group input::placeholder {
    color: var(--slate-300);
}

.bp-input-group span {
    color: var(--slate-400);
    font-size: 0.9rem;
}

/* Ads Section */
.bp-ads-container {
    margin-bottom: 1rem;
}

.bp-ad-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bp-ad-field {
    flex: 1;
}

.bp-ad-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--slate-400);
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.bp-ad-field select,
.bp-ad-field input {
    width: 100%;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid var(--slate-200);
    font-size: 1rem;
    color: var(--slate-800);
    background: transparent;
    outline: none;
}

.bp-ad-field select {
    cursor: pointer;
}

.bp-add-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px dashed #e2e8f0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--slate-400);
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.bp-add-ad:hover {
    border-color: var(--slate-400);
    color: var(--slate-500);
}

/* Result */
.bp-result-title {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 2rem;
}

.bp-result-content {
    text-align: left;
    background: white;
    border-radius: var(--radius-md);
    padding: 3rem;
    max-height: 75vh;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--slate-700);
    box-shadow: inset 0 0 0 1px var(--slate-100);
}

.bp-result-content h2, .bp-result-content h3, .bp-result-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Business Plan Result Prose */
.bp-result-prose {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--bs-body-color);
    text-align: left;
    max-width: 100%;
}

.bp-result-prose h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bs-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bp-result-prose h2:first-child {
    margin-top: 0;
}

.bp-result-prose h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--bs-primary);
}

.bp-result-prose h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.bp-result-prose p {
    margin-bottom: 0.75rem;
    text-align: left;
}

.bp-result-prose ul {
    margin-bottom: 1rem;
    padding-left: 0;
    list-style: none;
}

.bp-result-prose li {
    margin-bottom: 0.4rem;
    padding-left: 1.25rem;
    position: relative;
    text-align: left;
}

.bp-result-prose li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    background: var(--bs-primary);
    border-radius: 50%;
}

.bp-result-prose strong {
    color: var(--bs-body-color);
    font-weight: 600;
}

.bp-result-prose hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px dashed var(--bs-border-color);
}

.bp-result-prose blockquote {
    background: var(--bs-tertiary-bg);
    border-left: 4px solid var(--bs-primary);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
}

.bp-result-prose blockquote p {
    margin-bottom: 0.25rem;
}

.bp-result-prose blockquote p:last-child {
    margin-bottom: 0;
}

.bp-result-prose table {
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    font-size: 0.9rem;
    border: 1px solid var(--bs-border-color);
}

.bp-result-prose th {
    background: var(--bs-primary);
    color: white;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bp-result-prose td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
    text-align: left;
}

.bp-result-prose tr:last-child td {
    border-bottom: none;
}

.bp-result-prose tr:nth-child(even) {
    background: var(--bs-tertiary-bg);
}

.bp-result-prose code {
    background: var(--bs-tertiary-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
}

/* Emoji indicators */
.bp-result-prose p:has(✅),
.bp-result-prose p:has(⚠️),
.bp-result-prose p:has(📈),
.bp-result-prose p:has(📊) {
    padding-left: 0;
}

.bp-restart-btn {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 2rem;
    color: var(--slate-600);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.bp-restart-btn:hover {
    background: var(--slate-50);
}

/* Loading */
.bp-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.95);
    z-index: 10;
}

.bp-loading.hidden {
    display: none;
}

.bp-loading p {
    margin-top: 1rem;
    color: var(--slate-500);
}

.bp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Business Plan Responsive */
@media (max-width: 768px) {
    .bp-wizard {
        padding: 1rem;
    }

    .bp-figures-row {
        flex-direction: column;
    }

    .bp-ad-row {
        flex-direction: column;
    }

    .bp-result-content {
        padding: 1rem;
        max-height: 50vh;
    }
}
