/* Theme Variables */
:root {
    --bg-main: #020617; /* Slate 950 / Navy */
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(0, 0, 0, 0.4);
    --navbar-border: rgba(255, 255, 255, 0.1);
    --navbar-border: rgba(255, 255, 255, 0.1);
    --selection-bg: rgba(59, 130, 246, 0.3);
    --scrollbar-track: #020617;
    --scrollbar-thumb: #1e293b;
    --mesh-opacity: 0.1;
    --canvas-opacity: 1;
}

.light-theme {
    --bg-main: #f8fafc; /* Pristine Slate-White */
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(15, 23, 42, 0.05); /* Very subtle Slate 900 border */
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --navbar-border: rgba(0, 0, 0, 0.05);
    --selection-bg: rgba(59, 130, 246, 0.1);
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --mesh-opacity: 0.15;
    --canvas-opacity: 0.4;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 3px solid var(--scrollbar-track);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

::selection {
    background: var(--selection-bg);
}

/* Ambient Corner Glows for Elite Light Mode */
html.light-theme::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -15;
    background: 
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
    pointer-events: none;
}

/* Global Transitions */
*, *::before, *::after {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease-in-out, opacity 0.4s ease;
}

/* Override Classes */
html.light-theme, body.light-theme {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--text-primary) !important;
}

body {
    color: var(--text-primary) !important;
}

.bg-vbrs-navy, 
[class*="bg-vbrs-navy"],
.bg-black,
.bg-slate-950 {
    background-color: var(--bg-main) !important;
}

.text-slate-100, .text-slate-200, .text-slate-300, .text-slate-400, .text-slate-500, .text-gray-300, .text-gray-400 {
    color: var(--text-secondary) !important;
}

/* Aggressive Text Overrides for Light Theme */
.light-theme .text-white, 
.light-theme h1, 
.light-theme h2, 
.light-theme h3, 
.light-theme h4, 
.light-theme h5, 
.light-theme h6,
.light-theme .text-slate-100,
.light-theme .text-slate-200,
.light-theme .text-slate-300,
.light-theme .text-slate-400,
.light-theme .text-slate-500,
.light-theme .text-gray-300,
.light-theme .text-gray-400,
.light-theme p,
.light-theme [class*="text-white/"],
.light-theme [class*="text-slate-"],
.light-theme [class*="text-gray-"] {
    color: var(--text-primary) !important;
    opacity: 1 !important;
}

/* Specific slate overrides for secondary text */
.light-theme .text-slate-400, 
.light-theme .text-slate-500,
.light-theme .text-gray-400,
.light-theme .text-gray-500 {
    color: var(--text-secondary) !important;
}

/* Navbar */
#main-navbar {
    background-color: var(--navbar-bg) !important;
    border-color: var(--navbar-border) !important;
}

/* Icons and Dropdowns */
.light-theme .nav-item {
    color: var(--text-secondary);
}

.light-theme .nav-item:hover, .light-theme .nav-item.text-vbrs-blue {
    color: #3b82f6 !important; /* Keep vbrs-blue */
}

.light-theme #mobile-menu-toggle {
    color: var(--text-primary) !important;
}

/* Mesh Gradient Opacity */
.bg-mesh-gradient {
    opacity: var(--mesh-opacity) !important;
}

/* Hide dark gradients in light theme (but preserve for buttons) */
.light-theme div[class*="bg-gradient-to-"],
.light-theme section[class*="bg-gradient-to-"] {
    opacity: 0.1 !important;
}

.light-theme a[class*="bg-gradient-to-"],
.light-theme button[class*="bg-gradient-to-"],
.light-theme .btn-shine {
    opacity: 1 !important;
    color: #ffffff !important;
    background-image: linear-gradient(to right, var(--tw-gradient-from), var(--tw-gradient-to)) !important;
}

/* Logo Contrast Override (Reverted) */
.light-theme img.h-full.w-auto.object-contain {
    filter: none !important;
}

/* Footer Override */
.light-theme footer {
    background: var(--bg-main) !important;
    border-top: 1px solid var(--navbar-border);
}

/* Glass Panels - Elite Refinement (Light Mode) */
.glass-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(249, 115, 22, 0.12) 100%), var(--card-bg) !important;
    border-color: rgba(59, 130, 246, 0.1) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    box-shadow: 
        0 10px 20px -5px rgba(15, 23, 42, 0.03),
        0 4px 6px -2px rgba(15, 23, 42, 0.02) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.light-theme .glass-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(249, 115, 22, 0.08) 100%), rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.15) !important;
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.1) !important;
}

.light-theme .glass-panel:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(249, 115, 22, 0.15) 100%), rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    box-shadow: 
        0 20px 40px -10px rgba(15, 23, 42, 0.06),
        0 10px 15px -5px rgba(15, 23, 42, 0.04) !important;
    transform: translateY(-4px) scale(1.005);
}

/* Global Text Readability Backing */
.text-blur-backing {
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.light-theme .text-blur-backing {
    background: rgba(255, 255, 255, 0.4) !important;
    border-color: rgba(0, 0, 0, 0.05);
}

/* Divider Lines and Gradients */
.light-theme .h-px.bg-gradient-to-r.from-white\/10 {
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent) !important;
}

/* Background Badges (vbrs-blue/5, etc) */
.light-theme [class*="bg-vbrs-"][class*="/"] {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Image Visibility */
.light-theme img {
    opacity: 1 !important;
    filter: none !important;
}

.light-theme .opacity-40,
.light-theme .opacity-60,
.light-theme .opacity-80 {
    opacity: 1 !important;
}

/* 3D Canvas Container */
#canvas-container {
    opacity: 1 !important;
}

/* Mesh Gradient Opacity */
.bg-mesh-gradient {
    opacity: var(--mesh-opacity) !important;
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(12deg);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}

.theme-toggle-btn i {
    width: 20px;
    height: 20px;
}

/* Elite CTA Module Visibility (Light Mode Fix) */
.light-theme .elite-cta .cta-title {
    color: #0f172a !important; /* Force Slate 900 */
}

.light-theme .elite-cta .cta-desc {
    color: #475569 !important; /* Force Slate 600 */
}

.light-theme .elite-cta .cta-secondary-btn {
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

.light-theme .elite-cta .glass-panel {
    background: rgba(255, 255, 255, 0.9) !important; /* Darker glass for contrast */
}

/* Gradient Buttons - Visibility Fix (Light Mode) */
.light-theme .bg-gradient-to-r,
.light-theme [class*="bg-gradient-to-"],
.light-theme .btn-shine,
.light-theme .bg-vbrs-blue,
.light-theme .bg-vbrs-orange,
.light-theme .bg-vbrs-magenta {
    color: #ffffff !important;
}

.light-theme .bg-gradient-to-r *,
.light-theme [class*="bg-gradient-to-"] *,
.light-theme .btn-shine * {
    color: #ffffff !important;
}

/* Ensure icons inside gradient buttons are also white */
.light-theme .bg-gradient-to-r i,
.light-theme [class*="bg-gradient-to-"] i {
    color: #ffffff !important;
}
