:root {
    --luminai-primary: #6D28D9;
    --luminai-secondary: #A78BFA;
    --luminai-accent: #f59e0b;
    --luminai-neon: #6D28D9;
    --luminai-neon-purple: #A78BFA;
    --luminai-glass: rgba(255, 255, 255, 0.1);
    --luminai-glass-border: rgba(255, 255, 255, 0.2);
    --luminai-dark-bg: #0a0a0b;
    --luminai-dark-surface: #1a1a1e;
    --luminai-dark-card: #2d2d34;
    --luminai-text-primary: #ffffff;
    --luminai-text-secondary: #b8b8b8;
    --luminai-text-muted: #9ca3af;
    --luminai-ai-gradient: linear-gradient(135deg, #6D28D9, #A78BFA);
    --luminai-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);

    /* Modal variables - Dark theme defaults */
    --luminai-overlay-bg: rgba(0, 0, 0, 0.85);
    --luminai-card-bg: #1a1a1a;
    --luminai-border-color: rgba(255, 255, 255, 0.1);
    --luminai-shadow: rgba(0, 0, 0, 0.6);
    --luminai-modal-header-bg: linear-gradient(135deg, rgba(109, 40, 217, 0.03) 0%, rgba(167, 139, 250, 0.03) 100%);
    --luminai-modal-footer-bg: rgba(0, 0, 0, 0.2);
    --luminai-input-bg: rgba(255, 255, 255, 0.04);
    --luminai-input-focus-bg: rgba(255, 255, 255, 0.06);
    --luminai-btn-secondary-bg: rgba(255, 255, 255, 0.08);
    --luminai-btn-secondary-hover: rgba(255, 255, 255, 0.15);

    /* Search field variables */
    --luminai-search-bg: var(--luminai-dark-surface);
    --luminai-search-border: rgba(255, 255, 255, 0.2);
    --luminai-search-text: #ffffff;
}

/* Dark Theme - Make text-muted more visible */
.text-muted {
    color: var(--luminai-text-muted) !important;
}

/* Logo Theme Switching */
.logo-light-theme {
    display: none;
}

.logo-dark-theme {
    display: inline-block;
}

[data-theme="light"] .logo-light-theme {
    display: inline-block;
}

[data-theme="light"] .logo-dark-theme {
    display: none;
}

/* Organization Logo Theme Switching */
.org-logo-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.org-logo-light {
    display: none;
}

.org-logo-dark {
    display: inline-block;
}

[data-theme="light"] .org-logo-light {
    display: inline-block;
}

[data-theme="light"] .org-logo-dark {
    display: none;
}

.org-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--luminai-ai-gradient);
}

.org-icon-fallback i {
    color: white;
}

/* User Avatar - Rounded Square Pattern */
.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--luminai-ai-gradient);
    border-radius: 8px;
}

.user-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

/* Three Dots Button - Theme Aware */
.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.8);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
}

[data-theme="light"] .btn-outline-light {
    border-color: rgba(0, 0, 0, 0.3);
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .btn-outline-light:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.5);
    color: #000000;
}

/* Danger Button - Theme Aware */
.btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: rgba(239, 68, 68, 0.8);
}

.btn-outline-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.8);
    color: #ef4444;
}

[data-theme="light"] .btn-outline-danger {
    border-color: rgba(220, 38, 38, 0.5);
    color: #dc2626;
}

[data-theme="light"] .btn-outline-danger:hover {
    background-color: rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
    color: #b91c1c;
}

/* Text Danger - Theme Aware */
.text-danger,
.dropdown-item.text-danger {
    color: #ef4444 !important;
}

[data-theme="light"] .text-danger,
[data-theme="light"] .dropdown-item.text-danger {
    color: #dc2626 !important;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

[data-theme="light"] .dropdown-item.text-danger:hover {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #b91c1c !important;
}

/* Dropdown Menu Styling - Dark Theme */
.dropdown-menu {
    background: rgba(26, 26, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.dropdown-item {
    color: var(--luminai-text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.2), rgba(167, 139, 250, 0.2));
    color: var(--luminai-text-primary);
    transform: translateX(4px);
}

.dropdown-item:active {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.3), rgba(167, 139, 250, 0.3));
}

.dropdown-item i {
    width: 20px;
    transition: transform 0.2s ease;
}

.dropdown-item:hover i {
    transform: scale(1.1);
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

body {
    background: var(--luminai-bg-primary, linear-gradient(135deg, var(--luminai-dark-bg) 0%, #1a1a2e 50%, #16213e 100%));
    color: var(--luminai-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    padding-bottom: 100px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(109, 40, 217, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.3s ease;
}

/* Light Theme Overrides */
[data-theme="light"] body {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
    color: #1a1a1a;
}

[data-theme="light"] body::before {
    opacity: 0.3;
}

[data-theme="light"] .luminai-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .luminai-navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .ai-dashboard-header {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .metric-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .text-white {
    color: #1a1a1a !important;
}

[data-theme="light"] .text-secondary {
    color: #4a5568 !important;
}

[data-theme="light"] .navbar-brand .text-white {
    color: #1a1a1a !important;
}

[data-theme="light"] .nav-link.text-white {
    color: #1a1a1a !important;
}

[data-theme="light"] .nav-link.text-white:hover {
    color: var(--luminai-primary) !important;
}

/* Light Theme - Darker Neon Color */
[data-theme="light"] .text-neon {
    color: #0066cc !important;
    text-shadow: 0 0 10px rgba(0, 102, 204, 0.3);
}

/* Light Theme - Navbar Toggle Button Fix */
[data-theme="light"] .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.3) !important;
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

[data-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Light Theme - Dropdown Menu Fix */
[data-theme="light"] .dropdown-menu {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .dropdown-item {
    color: #1a1a1a !important;
}

[data-theme="light"] .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(167, 139, 250, 0.1)) !important;
    color: #6D28D9 !important;
}

[data-theme="light"] .dropdown-item:active {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.15), rgba(167, 139, 250, 0.15)) !important;
}

[data-theme="light"] .dropdown-divider {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Light Theme - AI Status and Real-time Badge Adjustments */
[data-theme="light"] .ai-status-indicator {
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: #0066cc;
}

[data-theme="light"] .real-time-badge {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #059669;
}

/* Light Theme - Button Adjustments */
[data-theme="light"] .luminai-btn-ai {
    background: linear-gradient(135deg, #6D28D9, #A78BFA);
    border: 1px solid rgba(109, 40, 217, 0.3);
}

[data-theme="light"] .luminai-btn-ai:hover {
    background: linear-gradient(135deg, #5B21B6, #9333EA);
}

.luminai-navbar {
    background: rgba(26, 26, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.37);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.luminai-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--luminai-ai-gradient);
}

.luminai-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.luminai-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.luminai-card {
    background: rgba(45, 45, 52, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    box-shadow: var(--luminai-glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    z-index: 1;
}

/* Ensure dropdown menu always appears on top */
.dropdown-menu {
    z-index: 9999 !important;
}

.luminai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.luminai-card.ai-enhanced {
    border: 1px solid rgba(109, 40, 217, 0.3);
    box-shadow: 0 8px 32px rgba(109, 40, 217, 0.1), var(--luminai-glass-shadow);
}

.luminai-card.ai-enhanced::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--luminai-ai-gradient);
    box-shadow: 0 0 12px rgba(109, 40, 217, 0.8);
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.luminai-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.4), 0 0 20px rgba(79, 70, 229, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.luminai-card:hover::before {
    opacity: 1;
}

/* Card with open dropdown must stay above hovered cards */
.luminai-card:has(.dropdown.show) {
    z-index: 9999 !important;
}

.luminai-btn-primary {
    background: linear-gradient(135deg, #6D28D9, #A78BFA);
    border: 1px solid rgba(109, 40, 217, 0.3);
    color: var(--luminai-text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.3);
}

.luminai-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.luminai-btn-ai {
    background: linear-gradient(135deg, #6D28D9, #A78BFA);
    border: 1px solid rgba(109, 40, 217, 0.3);
    color: var(--luminai-text-primary);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.luminai-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(109, 40, 217, 0.5);
    border-color: rgba(167, 139, 250, 0.6);
    background: linear-gradient(135deg, #5B21B6, #9333EA);
}

.luminai-btn-primary:hover::before {
    left: 100%;
}

.luminai-btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.5);
    background: linear-gradient(135deg, #5B21B6, #9333EA);
}

/* Luminai Button Variants - Consistent Sizing */
.luminai-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--luminai-text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.luminai-btn-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.luminai-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.6);
}

.luminai-btn-success:hover::before {
    left: 100%;
}

.luminai-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #ffffff;
    transition: all 0.3s ease;
}

.luminai-btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.luminai-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transition: all 0.3s ease;
}

.luminai-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.luminai-btn-secondary {
    background: var(--luminai-btn-secondary-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--luminai-text-primary);
    transition: all 0.3s ease;
}

.luminai-btn-secondary:hover {
    background: var(--luminai-btn-secondary-hover);
    transform: translateY(-1px);
}

/* Ensure consistent sizing for small action buttons */
.btn-sm.luminai-btn-success,
.btn-sm.luminai-btn-warning,
.btn-sm.luminai-btn-danger,
.btn-sm.luminai-btn-secondary,
.btn-sm.luminai-btn-primary,
.btn-sm.luminai-btn-ai {
    min-width: 36px;
    min-height: 36px;
    padding: 0.4rem 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Icon-only buttons should be square and same size */
.btn-sm.luminai-btn-success:has(i:only-child),
.btn-sm.luminai-btn-warning:has(i:only-child),
.btn-sm.luminai-btn-danger:has(i:only-child),
.btn-sm.luminai-btn-secondary:has(i:only-child),
.btn-sm.luminai-btn-primary:has(i:only-child),
.btn-sm.luminai-btn-ai:has(i:only-child) {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6D28D9, #A78BFA);
    border-radius: 4px;
}

/* Enhanced alert styles */
.alert {
    border: none;
    border-radius: 0.75rem;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}


/* Modern CRM Layout Systems */

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 2rem;
}

.bento-item {
    background: var(--luminai-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bento-item.large {
    grid-column: span 2;
}

.bento-item.tall {
    grid-row: span 2;
}

/* AI Dashboard Elements */
.ai-dashboard-header {
    background: var(--luminai-dark-surface);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.ai-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(109, 40, 217, 0.1);
    border: 1px solid rgba(109, 40, 217, 0.3);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #A78BFA;
}

.ai-status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--luminai-ai-gradient);
    animation: aiPulse 2s ease-in-out infinite;
}

/* Modern Typography */
.text-gradient {
    background: var(--luminai-ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-neon {
    color: #A78BFA;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Real-time Data Indicators */
.real-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: #22c55e;
}

.real-time-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: realTimePulse 2s ease-in-out infinite;
}

@keyframes realTimePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Metric Cards */
.metric-card {
    background: var(--luminai-dark-surface);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--luminai-text-primary);
    margin: 0.5rem 0;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--luminai-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.trend-up {
    color: #22c55e;
}

.trend-down {
    color: #ef4444;
}

/* Page transitions */
main {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 2rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-item.large {
        grid-column: span 1;
    }
}

/* Fix navbar collapse behavior */
.navbar-collapse {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--luminai-dark-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    border-radius: 0 0 12px 12px;
    padding: 8px;
}

.navbar-collapse.show,
.navbar-collapse.collapsing {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Ensure container doesn't shift */
.navbar > .container {
    position: relative;
}

/* Navigation Menu Items Styling */
.navbar-collapse .navbar-nav {
    gap: 4px;
}

.navbar-collapse .nav-item {
    margin: 0;
}

.navbar-collapse .nav-link {
    color: var(--luminai-text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.navbar-collapse .nav-link:hover {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.2), rgba(167, 139, 250, 0.2));
    color: var(--luminai-text-primary);
    transform: translateX(4px);
}

.navbar-collapse .nav-link:active {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.3), rgba(167, 139, 250, 0.3));
}

.navbar-collapse .nav-link i {
    width: 20px;
    transition: transform 0.2s ease;
}

.navbar-collapse .nav-link:hover i {
    transform: scale(1.1);
}

/* Light Theme - Navigation Menu */
[data-theme="light"] .navbar-collapse {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .navbar-collapse .nav-link {
    color: #1a1a1a;
}

[data-theme="light"] .navbar-collapse .nav-link:hover {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(167, 139, 250, 0.1));
    color: #6D28D9;
}

/* Organization Switcher Styling */
.org-switcher-title {
    color: rgba(255, 255, 255, 0.6);
}

.org-switcher-subtitle {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .org-switcher-title {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .org-switcher-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

/* Light Theme - Modal Variables */
[data-theme="light"] {
    --luminai-overlay-bg: rgba(0, 0, 0, 0.6);
    --luminai-card-bg: #ffffff;
    --luminai-border-color: rgba(0, 0, 0, 0.1);
    --luminai-shadow: rgba(0, 0, 0, 0.2);
    --luminai-modal-header-bg: linear-gradient(135deg, rgba(109, 40, 217, 0.03) 0%, rgba(167, 139, 250, 0.03) 100%);
    --luminai-modal-footer-bg: rgba(0, 0, 0, 0.03);
    --luminai-text-primary: #1a1a1a;
    --luminai-text-secondary: #4a5568;
    --luminai-text-muted: #6b7280;
    --luminai-input-bg: rgba(0, 0, 0, 0.03);
    --luminai-input-focus-bg: rgba(0, 0, 0, 0.05);
    --luminai-btn-secondary-bg: rgba(0, 0, 0, 0.08);
    --luminai-btn-secondary-hover: rgba(0, 0, 0, 0.12);

    /* Search field variables - light theme */
    --luminai-search-bg: #ffffff;
    --luminai-search-border: rgba(0, 0, 0, 0.2);
    --luminai-search-text: #1a1a1a;
}

/* Luminai Table - Theme Aware - Override Bootstrap defaults */
.table.luminai-table,
.luminai-table {
    background: transparent !important;
    color: var(--luminai-text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-active-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

.luminai-table thead,
.luminai-table thead th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--luminai-text-primary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.luminai-table tbody,
.luminai-table tbody tr {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.luminai-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.luminai-table tbody td {
    padding: 1rem;
    border-color: rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    background: transparent !important;
}

/* Light Theme - Table Overrides */
[data-theme="light"] .table.luminai-table,
[data-theme="light"] .luminai-table {
    border-color: rgba(0, 0, 0, 0.1);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(0, 0, 0, 0.01);
    --bs-table-active-bg: rgba(0, 0, 0, 0.02);
    --bs-table-hover-bg: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .luminai-table thead,
[data-theme="light"] .luminai-table thead th {
    background: rgba(0, 0, 0, 0.03) !important;
    color: #1a1a1a !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .luminai-table tbody,
[data-theme="light"] .luminai-table tbody tr {
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .luminai-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .luminai-table tbody td {
    border-color: rgba(0, 0, 0, 0.05);
}

/* Video Navigation Controls - Theme Aware */
.video-nav-controls {
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

[data-theme="light"] .video-nav-controls {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Video Nav Controls - Form Check Label */
.video-nav-controls .form-check-label {
    color: #ffffff;
    cursor: pointer;
}

[data-theme="light"] .video-nav-controls .form-check-label {
    color: #1a1a1a;
}

/* Star Rating System */
.star-rating-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.clickable-stars {
    display: flex;
    gap: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.clickable-star {
    color: rgba(139, 92, 246, 0.2);
    transition: all 0.2s ease;
}

.clickable-star:hover {
    transform: scale(1.2);
}

.clickable-star.active {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* ============================================
   FULLSCREEN TEXTAREA EDITOR
   ============================================ */

/* Fullscreen button - always visible, positioned in container */
.fullscreen-textarea-btn-permanent {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: linear-gradient(135deg, #6D28D9, #A78BFA);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 13px;
    z-index: 100;
    opacity: 0.7;
}

.fullscreen-textarea-btn-permanent:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.5);
}

.fullscreen-textarea-btn-permanent i {
    color: white;
}

/* Fewshot remove button - same style as fullscreen, but red */
.fewshot-remove-btn-permanent {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 13px;
    z-index: 100;
    opacity: 0.7;
}

.fewshot-remove-btn-permanent:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

.fewshot-remove-btn-permanent i {
    color: white;
}

/* Fullscreen modal overlay */
.fullscreen-textarea-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--luminai-overlay-bg);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fullscreen container */
.fullscreen-textarea-container {
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    background: var(--luminai-card-bg);
    border-radius: 16px;
    border: 1px solid var(--luminai-border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

/* Header */
.fullscreen-textarea-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--luminai-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--luminai-modal-header-bg);
    border-radius: 16px 16px 0 0;
}

.fullscreen-textarea-header h3 {
    margin: 0;
    color: var(--luminai-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.fullscreen-textarea-header h3 i {
    color: var(--luminai-primary);
}

.btn-close-fullscreen {
    background: none;
    border: none;
    color: var(--luminai-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-close-fullscreen:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--luminai-text-primary);
}

.btn-close-fullscreen i {
    font-size: 1.25rem;
}

/* Body with textarea */
.fullscreen-textarea-body {
    flex: 1;
    padding: 2rem;
    overflow: auto;
}

.fullscreen-textarea-input {
    width: 100%;
    height: 100%;
    background: var(--luminai-input-bg);
    border: 1px solid var(--luminai-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--luminai-text-primary);
    font-size: 1rem;
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: none;
    transition: all 0.2s ease;
}

.fullscreen-textarea-input:focus {
    outline: none;
    background: var(--luminai-input-focus-bg);
    border-color: var(--luminai-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.fullscreen-textarea-input::placeholder {
    color: var(--luminai-text-muted);
}

/* Footer */
.fullscreen-textarea-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--luminai-border-color);
    display: flex;
    gap: 1rem;
    justify-content: center; /* Center single button */
    background: var(--luminai-modal-footer-bg);
    border-radius: 0 0 16px 16px;
}

.fullscreen-textarea-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.fullscreen-textarea-footer .btn-secondary {
    background: var(--luminai-btn-secondary-bg);
    color: var(--luminai-text-primary);
}

.fullscreen-textarea-footer .btn-secondary:hover {
    background: var(--luminai-btn-secondary-hover);
    transform: translateY(-2px);
}

/* Light theme adjustments */
[data-theme="light"] .fullscreen-textarea-modal {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .fullscreen-textarea-container {
    background: white;
    border-color: #e5e7eb;
}

[data-theme="light"] .fullscreen-textarea-header {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
}

[data-theme="light"] .fullscreen-textarea-header h3,
[data-theme="light"] .fullscreen-textarea-input {
    color: #1f2937;
}

[data-theme="light"] .fullscreen-textarea-input {
    background: #f9fafb;
    border-color: #e5e7eb;
}

[data-theme="light"] .fullscreen-textarea-input:focus {
    background: white;
    border-color: var(--luminai-primary);
}

[data-theme="light"] .btn-close-fullscreen {
    color: #6b7280;
}

[data-theme="light"] .btn-close-fullscreen:hover {
    background: #f3f4f6;
    color: #1f2937;
}

[data-theme="light"] .fullscreen-textarea-footer {
    background: #f9fafb;
}

[data-theme="light"] .fullscreen-textarea-footer .btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .fullscreen-textarea-footer .btn-secondary:hover {
    background: #d1d5db;
}

/* ============================================
   TURBO PROGRESS BAR
   ============================================ */

.turbo-progress-bar {
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6D28D9 0%, #A78BFA 100%);
    z-index: 9999;
    transition: width 300ms ease-out, opacity 150ms 150ms ease-in;
    transform: translate3d(0, 0, 0);
    box-shadow: 0 0 10px rgba(109, 40, 217, 0.5);
}

/* Add glow effect */
.turbo-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: turbo-progress-glow 2s ease-in-out infinite;
}

@keyframes turbo-progress-glow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Dark theme variant */
[data-theme="dark"] .turbo-progress-bar {
    background: linear-gradient(90deg, #6D28D9 0%, #A78BFA 100%);
    box-shadow: 0 0 10px rgba(109, 40, 217, 0.7);
}

/* Light theme variant */
[data-theme="light"] .turbo-progress-bar {
    background: linear-gradient(90deg, #5B21B6 0%, #9333EA 100%);
    box-shadow: 0 0 10px rgba(91, 33, 182, 0.5);
}
