/* =========================================
   1. GLOBAL VARIABLES & BASE TYPOGRAPHY
   ========================================= */
:root {
    --bs-primary: #64748B; /* Slate */
    --bs-primary-rgb: 100, 116, 139;
    --bs-dark: #171717; /* Neutral Deep Dark */
    --bs-dark-rgb: 23, 23, 23;
    
    /* Global Semantic Colors */
    --bg-adaptive: #ffffff;
    --text-adaptive: #334155;
    --heading-adaptive: #171717;
    --border-adaptive: #e2e8f0;
    --card-adaptive: #ffffff;
    --muted-adaptive: #64748b;
    
    --transition-speed: 0.3s;
    color-scheme: light dark;
}

[data-bs-theme="dark"] {
    --bg-adaptive: #171717;
    --text-adaptive: #94a3b8;
    --heading-adaptive: #f8fafc;
    --border-adaptive: rgba(255, 255, 255, 0.1);
    --card-adaptive: #212529;
    --muted-adaptive: #475569;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-adaptive);
    color: var(--text-adaptive);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}
/* =========================================
   2. COMPONENT OVERRIDES & BUTTONS
   ========================================= */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-primary:hover {
    background-color: #475569;
    border-color: #475569;
}

/* Fixes vanishing Dashboard/Login buttons in Dark Mode */
[data-bs-theme="dark"] .btn-outline-dark {
    color: #e2e8f0 !important;
    border-color: rgba(226, 232, 240, 0.5) !important;
}
[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: #e2e8f0 !important;
    color: #171717 !important;
    border-color: #e2e8f0 !important;
}

.text-primary { color: var(--bs-primary) !important; }
.bg-slate { background-color: var(--bs-primary) !important; color: white; }

/* Enterprise Focus Rings (Removes default bright blue browser glow) */
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(100, 116, 139, 0.25);
}

/* Global Card Hover Effects (Used primarily on landing page grids) */
.card {
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid rgba(0,0,0,0.1);
    height: 100%; 
}
[data-bs-theme="dark"] .card {
    border: 1px solid rgba(255,255,255,0.1);
    background-color: #212529;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Miscellaneous Adjustments */
.accordion-button:not(.collapsed) {
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--bs-primary);
}
.section-padding { padding: 5rem 0; }
.icon-box {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--bs-primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Fix for the Theme Toggle Oval Bug */
#themeToggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents squishing in flex containers */
    padding: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] #themeToggle {
    border-color: rgba(255,255,255,0.2);
}

#themeToggle i {
    font-size: 1.1rem;
}

/* =========================================
   3. LANDING PAGE SPECIFIC
   ========================================= */
.hero-section {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(23, 23, 23, 0.8), rgba(23, 23, 23, 0.8)), 
                url('https://picsum.photos/1920/1080?business,tech') no-repeat center center;
    background-size: cover;
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; text-align: center;
}

.hero-title {
    font-weight: 700; font-size: 3.5rem;
    letter-spacing: -1px; margin-bottom: 1.5rem;
}

.fade-in-section {
    opacity: 0; transform: translateY(30px); visibility: hidden;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, visibility;
}
.fade-in-section.is-visible {
    opacity: 1; transform: none; visibility: visible;
}

.sticky-bottom-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background-color: var(--bs-dark); color: white;
    padding: 10px 0; z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
[data-bs-theme="dark"] .sticky-bottom-bar {
    background-color: #000000; border-top: 1px solid #333;
}

#backToTopBtn {
    display: none; position: fixed; bottom: 80px; right: 20px;
    z-index: 1029; border-radius: 50%; width: 50px; height: 50px;
    text-align: center; line-height: 35px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Flash Message Progress Animation */
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-progress-bar {
    animation: toastProgress 5s linear forwards;
}

/* Logic for Pausing */
.alert:hover .toast-progress-bar {
    animation-play-state: paused;
}

/* =========================================
   NOTIFICATION HUB - ENTERPRISE INFRASTRUCTURE
   ========================================= */

/* 1. Main Dropdown Container */
#notificationList {
    padding: 12px !important; /* Internal spacing from dropdown edges */
    background-color: var(--blog-card-bg);
}

/* 2. Individual Notification Card */
.dropdown-item.notification-item {
    white-space: normal;
    padding: 14px 16px !important;
    margin-bottom: 8px; /* Gap between cards */
    border-radius: 12px !important;
    border: 1px solid transparent; 
    background-color: var(--blog-card-bg); 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    position: relative;
}

.dropdown-item.notification-item:hover {
    background-color: var(--blog-quote-bg) !important;
    border-color: var(--blog-border) !important;
    transform: translateY(-2px) !important; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 3. The Notif-Icon Squircle */
.notif-icon-container {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    background-color: var(--blog-quote-bg);
}

/* Centering Logic for FontAwesome Icons */
.notif-icon-container i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Solid" !important;
    font-weight: 900 !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    text-align: center;
}

/* 4. Category Color Logic (High Contrast) */
.bg-success-subtle { background-color: rgba(25, 135, 84, 0.12) !important; color: #198754 !important; }
.bg-danger-subtle  { background-color: rgba(220, 53, 69, 0.12) !important; color: #dc3545 !important; }
.bg-primary-subtle { background-color: rgba(13, 110, 253, 0.12) !important; color: #0d6efd !important; }
.bg-warning-subtle { background-color: rgba(245, 158, 11, 0.12) !important; color: #f59e0b !important; }
.bg-info-subtle    { background-color: rgba(13, 202, 240, 0.12) !important; color: #0dcaf0 !important; }

/* 5. Unread State Management */
.notification-unread {
    background-color: rgba(13, 110, 253, 0.05) !important;
    border-left: 4px solid #0d6efd !important;
}

[data-bs-theme="dark"] .notification-unread {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* 6. Single Delete Button Interaction */
li:hover .btn-delete-notif {
    opacity: 1 !important;
}

.btn-delete-notif {
    z-index: 10;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
}

.btn-delete-notif:hover {
    background-color: rgba(220, 53, 69, 0.15);
}

.btn-delete-notif:hover i {
    color: #dc3545 !important;
}

/* 7. Animations & Effects */
.notif-fade-out {
    opacity: 0 !important;
    transform: translateX(30px) !important;
    transition: all 0.3s ease;
    pointer-events: none;
}

@keyframes pulse-red {
    0% { transform: translate(50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.6); }
    70% { transform: translate(50%, -50%) scale(1.2); box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
    100% { transform: translate(50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.notif-badge-pulse {
    animation: pulse-red 2s infinite;
    border: 2px solid var(--blog-card-bg) !important;
}

/* Empty State Animations */
.animate-pulse-subtle {
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { 
        transform: translateY(0); 
        opacity: 0.7; 
    }
    50% { 
        transform: translateY(-6px); 
        opacity: 1; 
        filter: drop-shadow(0 5px 15px rgba(13, 110, 253, 0.3));
    }
}

/* Progress bar pulse */
@keyframes pulse-opacity {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

/* 8. Modern Scrollbar */
#notificationList::-webkit-scrollbar {
    width: 4px;
}
#notificationList::-webkit-scrollbar-thumb {
    background: var(--blog-border);
    border-radius: 10px;
}


/* =========================================
   4. ENTERPRISE SIMULATOR CONSOLE
   ========================================= */
.console-wrapper {
    padding-bottom: 2rem;
}

/* This fixes the footer breakout! Forces stacked cards to respect their content height */
.console-wrapper .card {
    height: auto !important; 
}
.console-wrapper .card:hover {
    transform: none !important; 
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

.console-font { font-family: 'Inter', sans-serif; line-height: 1.6; }
.bg-primary-tint { background-color: rgba(100, 116, 139, 0.05); }
[data-bs-theme="dark"] .text-dark { color: #f8f9fa !important; }
[data-bs-theme="dark"] .bg-primary-tint { background-color: rgba(100, 116, 139, 0.15); color: #fff !important; }
[data-bs-theme="dark"] .console-font { color: #e2e8f0; }

/* Smooth Evaluation Box */
#resultCard {
    animation: slideDown 0.4s ease-out forwards;
    width: 100%; 
    margin-bottom: 2rem; 
}

#result {
    max-height: 400px; 
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden; 
    white-space: pre-wrap !important;       
    word-wrap: break-word !important;       
    overflow-wrap: break-word !important;
    scrollbar-width: thin;
    scrollbar-color: #64748B transparent;
}

#result::-webkit-scrollbar { width: 6px; }
#result::-webkit-scrollbar-thumb { background-color: #64748B; border-radius: 10px; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
    * CHAT BOT
 =========================================== */

 .line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.kpi-card:hover img {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

#chat-content { height: 350px; scroll-behavior: smooth; }

/* Lift the Chatbot Toggle and Window upward */
#toggle-chat {
    bottom: 150px !important; /* Lifts the button above the Back-to-Top */
    right: 25px !important;
    position: fixed !important;
    z-index: 1001;
    /* Enterprise Grade Soft Shadow */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 10px 15px -3px rgba(13, 110, 253, 0.2), 
                0 0 0 1px rgba(13, 110, 253, 0.05);
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#toggle-chat:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(13, 110, 253, 0.25), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    filter: brightness(110%);
}

#chat-window {
    bottom: 195px !important; /* Lifts the window so it opens above the lifted button */
    right: 25px !important;
    position: fixed !important;
    z-index: 1000;
}
    
.chat-bubble { 
    max-width: 88%; 
    padding: 12px 16px; 
    border-radius: 18px; 
    font-size: 0.85rem; 
    margin-bottom: 12px; 
    line-height: 1.5; 
    word-wrap: break-word; 
    position: relative;
    transition: all 0.3s ease;
}

.ai-bubble { 
    align-self: flex-start; 
    background-color: var(--card-adaptive); 
    border: 1px solid var(--border-adaptive); 
    color: var(--text-adaptive); 
    border-bottom-left-radius: 4px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Dark Mode specific AI bubble polish */
[data-bs-theme="dark"] .ai-bubble {
    background-color: #1e293b; /* Deep slate bubble for better contrast */
}

.user-bubble { 
    align-self: flex-end; 
    background: #0d6efd; 
    color: white; 
    border-bottom-right-radius: 4px; 
    margin-left: auto; 
}

/* Input Field Polish */
#chat-input::placeholder {
    color: var(--muted-adaptive);
    opacity: 0.7;
}

[data-bs-theme="dark"] #chat-window {
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
}

/* Ensure Scrollbar matches theme */
#chat-content::-webkit-scrollbar { width: 4px; }
#chat-content::-webkit-scrollbar-thumb { 
    background: var(--border-adaptive); 
    border-radius: 10px; 
}

/* Enterprise Style Markdown Links as Buttons */
.chat-link {
    display: inline-block;
    margin: 6px 4px 2px 0;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Primary Blue for Login */
.chat-link-login {
    background-color: #0d6efd;
    color: white !important;
}

/* Success Green for Register */
.chat-link-register {
    background-color: #198754;
    color: white !important;
}

.chat-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    filter: brightness(110%);
}

/* Bold Text in Chat */
.chat-bubble strong {
    color: inherit;
    font-weight: 700;
}

.typing-indicator { font-style: italic; font-size: 0.75rem; color: #94a3b8; margin-bottom: 10px; }

/* Styling links specifically inside the chat bubble */
.chat-bubble a {
    color: #64748B; /* Slate Fallback */
    font-weight: 700;
    text-decoration: underline;
}

/* Enterprise Slate Button for Dashboard */
.chat-link-dashboard {
    background-color: #64748B !important; /* Premium Slate */
    color: white !important;
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(100, 116, 139, 0.2);
    transition: all 0.3s ease;
}

/* Enterprise Blue Button for Workspace */
.chat-link-workspace {
    background-color: #0d6efd !important;
    color: white !important;
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
    transition: all 0.3s ease;
}

.chat-link-dashboard:hover, .chat-link-workspace:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(110%);
}

/* =========================================
   5. DASHBOARD SPECIFIC
   ========================================= */
.kpi-card { 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    border-left: 4px solid var(--bs-primary) !important; 
}
.kpi-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important; 
}
[data-bs-theme="dark"] .kpi-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.4) !important;
}

.kpi-icon { 
    width: 48px; height: 48px; 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 12px; 
}
.chart-container { 
    position: relative; height: 300px; width: 100%; 
}

/* =========================================
   6. ENTERPRISE NAVBAR & DROPDOWN
   ========================================= */

/* 1. Remove Default Bootstrap Arrow */
.dropdown-toggle::after {
    display: none !important;
}

/* 2. Profile Avatar Circle */
.avatar-circle {
    width: 38px;
    height: 38px;
    background-color: #64748B;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

/* 3. Hover Animation (Triggered by the link) */
.nav-link.dropdown-toggle:hover .avatar-circle {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
}

/* 4. Chevron Animation & Sync */
#navChevron {
    transition: transform 0.3s ease, color 0.3s ease;
}

.dropdown-toggle:hover #navChevron {
    color: #0d6efd !important;
}

.dropdown-toggle[aria-expanded="true"] #navChevron {
    transform: rotate(180deg);
    color: #0d6efd !important;
}

/* 5. Dropdown Menu Styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
    border-radius: 12px;
    padding: 0.75rem;
    margin-top: 12px !important;
    animation: dropdownFade 0.2s ease-out;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e2125;
    box-shadow: 0 15px 50px rgba(0,0,0,0.6) !important;
    border: 1px solid rgba(255,255,255,0.08);
}

/* 6. Dropdown Items */
.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    transform: translateX(4px);
}

.dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545 !important;
}

.dropdown-item i {
    width: 1.2rem;
    margin-right: 10px;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* 7. Utilities */
.dropdown-divider {
    border-top: 1px solid rgba(0,0,0,0.06);
    margin: 0.5rem 0;
}
[data-bs-theme="dark"] .dropdown-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.x-small {
    font-size: 0.75rem;
    color: #94a3b8;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   8. PREMIUM ADAPTIVE NAVBAR
   ========================================= */
.navbar {
    background-color: var(--bg-adaptive) !important;
    border-bottom: 1px solid var(--border-adaptive);
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* FIX: Ensure no gaps and stays on top */
    top: 0 !important;
    z-index: 1050 !important; 
    position: fixed;
    width: 100%;
}

.nav-link {
    color: var(--text-adaptive) !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

/* Premium Profile Avatar Enhancement */
.avatar-circle {
    background-color: var(--bs-primary);
    border: 2px solid var(--border-adaptive);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Active State for Nav Links */
.nav-link.active {
    color: var(--bs-primary) !important;
    font-weight: 700;
}

/* Glassmorphism Logic - Use your specific --bs-dark color for consistency */
[data-bs-theme="light"] .navbar {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

/* Premium Hover for Adaptive Ghost Buttons */
.btn[style*="var(--border-adaptive)"]:hover {
    background-color: var(--bs-primary) !important;
    color: white !important;
    border-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .navbar {
    /* Using #171717 with transparency to match your style.css */
    background-color: rgba(23, 23, 23, 0.8) !important; 
}

/* =========================================
   9. GLOBAL WRAPPER SYNC (Enterprise Fix)
   ========================================= */
#blog-render-wrapper, 
#blog-home-wrapper, 
#admin-dashboard-wrapper, 
#admin-edit-wrapper,
#admin-compose-wrapper {
    margin-top: 0 !important;
    /* This creates the exact space needed for your py-3 navbar */
    padding-top: 100px !important; 
    min-height: 100vh;
    z-index: 1;
    position: relative;
    /* Ensure the background color is forced to the top */
    background-color: var(--bg-adaptive);
}

/* Ensure body doesn't have stray padding-top from Bootstrap defaults */
body {
    padding-top: 0 !important;
}

/* =========================================
   10. GLOBAL PAGE ARCHITECTURE 
   ========================================= */

/* Use this class as the top-level div in every template content block */
.page-wrapper {
    background-color: var(--bg-adaptive);
    color: var(--text-adaptive);
    min-height: 100vh;
    /* Pulls background behind fixed navbar and adds safe padding for text */
    margin-top: -3rem; 
    padding-top: 6.5rem; 
    transition: all var(--transition-speed) ease;
    position: relative;
    z-index: 1;
}

/* Global Form & Input Polish for Dark Mode */
[data-bs-theme="dark"] .bg-primary-tint { 
    background-color: rgba(100, 116, 139, 0.15) !important; 
}

[data-bs-theme="dark"] .bg-body-tertiary { 
    background-color: #111827 !important; 
}

[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .form-control:focus {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .progress {
    background-color: #0f172a !important; /* Deep navy track */
}

/* =========================================
   11. MOBILE DROPDOWN OPTIMIZATION
   ========================================= */
@media (max-width: 991.98px) {
    /* Prevent dropdown from going off-screen */
    .navbar-collapse .dropdown-menu {
        position: static !important; /* Let it flow naturally in the mobile menu */
        float: none;
        width: 100%;
        margin-top: 10px !important;
        border: none !important;
        background-color: rgba(100, 116, 139, 0.05) !important; /* Subtle tint */
        box-shadow: none !important;
        padding-left: 1rem;
    }

    /* Fix User Profile Alignment on Mobile */
    .navbar-nav .dropdown {
        width: 100%;
        margin-top: 10px;
    }

    .dropdown-toggle {
        justify-content: flex-start !important;
        padding: 10px 0 !important;
    }
    
    /* Ensure the vertical rule doesn't look weird on mobile */
    .vr {
        display: none !important;
    }
}

/* Desktop Polish: Ensure the dropdown stays within the viewport */
@media (min-width: 992px) {
    .dropdown-menu-end {
        right: 0;
        left: auto;
    }
}

/* =========================================
   12. FLOATING UI HIERARCHY (Sticky Bar Aware)
   ========================================= */

/* 1. Back to Top Button 
   Lifted to 90px (Sticky Bar ~60px + 30px gap) */
#backToTopBtn {
    display: none; 
    position: fixed; 
    bottom: 90px !important; 
    right: 25px;
    z-index: 1029; 
    border-radius: 50%; 
    width: 50px; 
    height: 50px;
    text-align: center; 
    line-height: 45px; /* Perfect center for the arrow */
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* 2. Chatbot Toggle 
   Sits above the Back-to-Top (90px + 45px + gap = 150px) */
#toggle-chat {
    position: fixed !important;
    bottom: 150px !important; 
    right: 20px !important;
    z-index: 1031;
    width: 60px; 
    height: 60px; 
    border: 4px solid var(--bg-adaptive) !important;
    box-shadow: 0 10px 25px -5px rgba(13, 110, 253, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Chat Window 
   Opens above the toggle button */
#chat-window {
    position: fixed !important;
    bottom: 220px !important; 
    right: 20px !important;
    z-index: 1030;
    width: 360px; 
    height: 500px; 
    border-radius: 16px; 
    overflow: hidden;
}

/* Hover Adjustments */
#backToTopBtn:hover {
    transform: translateY(-5px);
    background-color: var(--bs-primary) !important;
    color: white !important;
}

/* Responsive Fix for Mobile Sticky Bar */
@media (max-width: 768px) {
    /* If your sticky bar is taller on mobile, adjust these slightly higher */
    #backToTopBtn {
        bottom: 100px !important;
        right: 15px;
    }
    #toggle-chat {
        bottom: 155px !important;
        right: 10px !important;
    }
    #chat-window {
        width: calc(100% - 30px);
        right: 15px !important;
        bottom: 225px !important;
    }
}

/* =========================================
   13. SETTINGS NAVIGATION
   ========================================= */
/* PROFESSIONAL SIDEBAR NAVIGATION - THEME ADAPTIVE */
.nav-pills .nav-link {
    color: var(--home-text) !important;
    opacity: 0.7;
    border-radius: 8px !important; /* Slightly less round for enterprise feel */
    border: 1px solid transparent;
    margin-bottom: 4px;
}

/* THE 'CLEAN' ACTIVE STATE (No hard blue) */
.nav-pills .nav-link.active {
    background-color: rgba(13, 110, 253, 0.1) !important; /* Soft Tint */
    color: #0d6efd !important; /* Blue Text only */
    border: 1px solid rgba(13, 110, 253, 0.2) !important;
    opacity: 1;
    font-weight: 600;
    /* Vertical Accent Line */
    position: relative;
}

/* Subtle hover for inactive links */
.nav-pills .nav-link:hover:not(.active) {
    background-color: var(--home-filter-btn);
    opacity: 1;
    transform: translateX(4px);
}

/* Red Logout Link styling */
.nav-link.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* USER DROPDOWN MENU LINK ITEMS */
.fw-black { font-weight: 900; }
    
    .pulse-indicator {
        font-size: 0.5rem;
        /* Professional Cyber Emerald Green */
        color: #10b981; 
        margin-left: 1.5rem; 
        filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.4));
        animation: workspace-pulse 2s infinite;
    }

    @keyframes workspace-pulse {
        0% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.3); opacity: 0.4; }
        100% { transform: scale(1); opacity: 1; }
    }

    /* Subtle hover effect for dropdown items */
    .dropdown-item:hover {
        background-color: var(--bg-body-tertiary);
    }