/* ==========================================================================
   SynapseAI — Quantum Violet Design Token System & Animation Engine
   Tailwind CSS v3.4 Extension + Vanilla JS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Dark Theme (Default) */
  --bg-base: #080B14;
  --bg-surface: #0D1117;
  --bg-elevated: #111827;
  --bg-hover: #1C2333;
  --bg-input: rgba(17, 24, 39, 0.7);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-brand: rgba(124, 58, 237, 0.35);

  --brand-primary: #7C3AED;
  --brand-hover: #6D28D9;
  --brand-glow: #8B5CF6;
  --brand-light: #DDD6FE;

  --accent-cyan: #06B6D4;
  --accent-cyan-glow: #22D3EE;
  --accent-green: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --card-glass: rgba(17, 24, 39, 0.65);
  --card-border: rgba(124, 58, 237, 0.18);
  --glass-blur: 20px;
}

/* Light Theme Variables */
html.light {
  --bg-base: #F8F9FF;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F1F4FD;
  --bg-input: #FFFFFF;

  --border-subtle: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-brand: rgba(124, 58, 237, 0.3);

  --brand-primary: #7C3AED;
  --brand-hover: #6D28D9;
  --brand-glow: #8B5CF6;
  --brand-light: #EDE9FE;

  --accent-cyan: #0891B2;
  --accent-cyan-glow: #06B6D4;
  --accent-green: #059669;
  --accent-amber: #D97706;
  --accent-rose: #E11D48;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --card-glass: rgba(255, 255, 255, 0.85);
  --card-border: rgba(124, 58, 237, 0.15);
  --glass-blur: 16px;
}

/* Base resets & typography */
body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.02em;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   Background Aurora Atmosphere & Noise Overlay
   ========================================================================== */

.aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
}

.aurora-blob-1 {
  top: -100px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.35) 0%, rgba(124, 58, 237, 0) 70%);
  animation: auroraFloat1 24s infinite alternate ease-in-out;
}

.aurora-blob-2 {
  top: 50px;
  right: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(6, 182, 212, 0) 70%);
  animation: auroraFloat2 28s infinite alternate ease-in-out;
}

.aurora-blob-3 {
  bottom: -150px;
  left: 25%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(139, 92, 246, 0) 70%);
  animation: auroraFloat3 32s infinite alternate ease-in-out;
}

html.light .aurora-blob-1 {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, rgba(124, 58, 237, 0) 70%);
}
html.light .aurora-blob-2 {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.10) 0%, rgba(6, 182, 212, 0) 70%);
}
html.light .aurora-blob-3 {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0) 70%);
}

@keyframes auroraFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(90px, 70px) scale(1.15); }
  100% { transform: translate(-50px, 40px) scale(0.95); }
}

@keyframes auroraFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, 90px) scale(1.1); }
  100% { transform: translate(60px, -40px) scale(0.9); }
}

@keyframes auroraFloat3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -70px) scale(1.08); }
  100% { transform: translate(-70px, -30px) scale(0.92); }
}

/* Subtle Grain / Noise Overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Glassmorphism & Component Tokens
   ========================================================================== */

.glass-card {
  background: var(--card-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.glass-card-hover:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35), 0 0 20px rgba(124, 58, 237, 0.12);
}

.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
}

.glow-brand {
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.35);
}

.glow-cyan {
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.35);
}

.gradient-text-brand {
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #06B6D4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ==========================================================================
   Keyframe Animations System
   ========================================================================== */

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.6);
  }
}

@keyframes scanLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(1000%); }
}

@keyframes waveBar {
  0%, 100% { height: 6px; }
  50% { height: 28px; }
}

@keyframes shimmerSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinSlowReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes pulseHalo {
  0%, 100% {
    transform: scale(1);
    opacity: 0.65;
    box-shadow: 0 0 35px rgba(124, 58, 237, 0.4), inset 0 0 25px rgba(6, 182, 212, 0.3);
  }
  50% {
    transform: scale(1.08);
    opacity: 0.95;
    box-shadow: 0 0 55px rgba(124, 58, 237, 0.7), inset 0 0 40px rgba(6, 182, 212, 0.6);
  }
}

.anim-orbit-clockwise {
  animation: spinSlow 22s linear infinite;
}

.anim-orbit-counter {
  animation: spinSlowReverse 26s linear infinite;
}

.anim-pulse-halo {
  animation: pulseHalo 4s ease-in-out infinite;
}

@keyframes studioRing { 
  0% { box-shadow: rgba(124, 58, 237, 0.38) 0px 0px 0px 0px; }
  70% { box-shadow: rgba(124, 58, 237, 0) 0px 0px 0px 8px; }
  100% { box-shadow: rgba(124, 58, 237, 0) 0px 0px 0px 0px; }
}

@keyframes studioBreathe { 
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

@keyframes studioOrb { 
  0%, 100% { opacity: 1; border-radius: 999px; transform: scale(1); }
  50% { opacity: 0.85; border-radius: 42%; transform: scale(1.12); }
}

.anim-studio-ring {
  animation: studioRing 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.anim-studio-breathe {
  animation: studioBreathe 3.5s ease-in-out infinite;
}

.anim-studio-orb {
  animation: studioOrb 6s ease-in-out infinite;
}

/* Card Tint Color Combinations (Pastel Frosted Gradients) */
.card-tint-violet {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16) 0%, rgba(17, 24, 39, 0.65) 100%) !important;
  border: 1px solid rgba(124, 58, 237, 0.32) !important;
}
html.light .card-tint-violet {
  background: linear-gradient(135deg, #FAF5FF 0%, #FFFFFF 100%) !important;
  border-color: rgba(124, 58, 237, 0.22) !important;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.06) !important;
}

.card-tint-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(17, 24, 39, 0.65) 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.32) !important;
}
html.light .card-tint-emerald {
  background: linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 100%) !important;
  border-color: rgba(16, 185, 129, 0.22) !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.06) !important;
}

.card-tint-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(17, 24, 39, 0.65) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
}
html.light .card-tint-amber {
  background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 100%) !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.06) !important;
}

.card-tint-cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(17, 24, 39, 0.65) 100%) !important;
  border: 1px solid rgba(6, 182, 212, 0.32) !important;
}
html.light .card-tint-cyan {
  background: linear-gradient(135deg, #ECFEFF 0%, #FFFFFF 100%) !important;
  border-color: rgba(6, 182, 212, 0.22) !important;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.06) !important;
}

/* Generator Studio Particle Glow Badges */
.studio-generator-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.studio-generator-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

/* Dropdown Menu Overlay & Styling */
.topbar-dropdown {
  position: relative;
}
.topbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: rgba(13, 17, 23, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}
html.light .topbar-dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: #E2E8F0;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.1);
}
.topbar-dropdown:hover .topbar-dropdown-menu,
.topbar-dropdown:focus-within .topbar-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Responsive Breakpoint Utilities */
@media (min-width: 1200px) {
  .xl\:block { display: block !important; }
  .xl\:flex { display: flex !important; }
  .xl\:inline-flex { display: inline-flex !important; }
  .xl\:hidden { display: none !important; }
  .xl\:flex-row { flex-direction: row !important; }
  .xl\:w-80 { width: 20rem !important; }
  .xl\:max-w-2xl { max-width: 42rem !important; }
  .xl\:pt-0 { padding-top: 0 !important; }
}
@media (min-width: 1400px) {
  .xxl\:flex, .\2xl\:flex { display: flex !important; }
  .xxl\:block, .\2xl\:block { display: block !important; }
  .xxl\:hidden, .\2xl\:hidden { display: none !important; }
}

.anim-fade-up {
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-fade-in {
  animation: fadeIn 0.35s ease both;
}

.anim-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger delay helpers */
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-250 { animation-delay: 250ms; }
.delay-300 { animation-delay: 300ms; }

/* AI Specific Animations */
.typing-cursor::after {
  content: '▋';
  display: inline-block;
  margin-left: 2px;
  color: var(--accent-cyan);
  animation: cursorBlink 0.9s infinite;
}

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

.thinking-dot {
  width: 7px;
  height: 7px;
  background-color: var(--brand-glow);
  border-radius: 50%;
  animation: thinkingBounce 1.4s infinite ease-in-out;
}
.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinkingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.waveform-bar {
  width: 3px;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--brand-primary) 100%);
  border-radius: 2px;
  animation: waveBar 1.2s infinite ease-in-out;
}

.scan-line-anim {
  position: absolute;
  inset-x: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 15px var(--accent-cyan);
  animation: scanLine 2.5s infinite linear;
}

/* Shimmer Skeleton */
.skeleton-shimmer {
  position: relative;
  overflow: hidden;
  background: var(--bg-hover);
}
.skeleton-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmerSweep 1.8s infinite;
}

/* ==========================================================================
   Custom Scrollbar & Form Controls
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* Modern inputs & focus */
.synapse-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 0.625rem;
  padding: 0.625rem 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
}
.synapse-input.input-with-icon-left,
.synapse-input-icon-left,
.synapse-input-group input.synapse-input-with-icon-left,
.synapse-input-group input.synapse-input-with-both-icons,
input.synapse-input.input-with-icon-left,
input.synapse-input.input-with-both-icons {
  padding-left: 2.75rem !important;
}
.synapse-input.input-with-icon-right,
.synapse-input-icon-right,
.synapse-input-group input.synapse-input-with-icon-right,
.synapse-input-group input.synapse-input-with-both-icons,
input.synapse-input.input-with-icon-right,
input.synapse-input.input-with-both-icons {
  padding-right: 2.75rem !important;
}
.synapse-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* Bulletproof input icon positioning */
.synapse-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.synapse-input-group .synapse-icon-left {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  color: #94A3B8;
  width: 1rem;
  height: 1rem;
}
.synapse-input-group .synapse-icon-right {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: #94A3B8;
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
.synapse-input-group .synapse-icon-right:hover {
  color: #F8FAFC;
}
html.light .synapse-input-group .synapse-icon-left {
  color: #64748B !important;
}
html.light .synapse-input-group .synapse-icon-right {
  color: #64748B !important;
}
html.light .synapse-input-group .synapse-icon-right:hover {
  color: #0F172A !important;
}

/* ==========================================================================
   Frosted Glassmorphism Engine (Dark Mode Default)
   ========================================================================== */

.sidebar-main {
  width: 16rem;
  background: rgba(13, 17, 23, 0.72) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

header, .topbar-header {
  background: rgba(8, 11, 20, 0.65) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.glass-card {
  background: rgba(17, 24, 39, 0.52) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(124, 58, 237, 0.2) !important;
  border-radius: 1rem;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.glass-card-hover:hover {
  transform: translateY(-3px);
  background: rgba(23, 32, 51, 0.68) !important;
  border-color: rgba(124, 58, 237, 0.45) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 25px rgba(124, 58, 237, 0.15) !important;
}

/* ==========================================================================
   Crisp Light Mode Engine (html.light)
   ========================================================================== */

/* Light mode icon toggles */
html.light .light\:block {
  display: block !important;
}
html.light .light\:hidden {
  display: none !important;
}

/* Base Body & Main Canvas in Light Mode */
html.light,
html.light body,
html.light body[class*="bg-"],
html.light .bg-\[\#080B14\],
html.light main,
html.light .main-content {
  background-color: #F8F9FF !important;
  color: #0F172A !important;
}

/* Light Mode Frosted Sidebar */
html.light .sidebar-main {
  background: rgba(255, 255, 255, 0.84) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-right: 1px solid #E5E7EB !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02) !important;
}

html.light .sidebar-main .sidebar-text,
html.light .sidebar-main .nav-link {
  color: #475569 !important;
}

html.light .sidebar-main .text-white:not(a.bg-violet-600 *):not(button.bg-violet-600 *):not(a[class*="bg-violet-600"] *):not(button[class*="bg-violet-600"] *) {
  color: #0F172A !important;
}

html.light .sidebar-main .bg-gradient-to-br {
  background: linear-gradient(135deg, rgba(245, 243, 255, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%) !important;
  border-color: rgba(124, 58, 237, 0.2) !important;
}

html.light .sidebar-main .nav-link:hover {
  color: #0F172A !important;
  background-color: rgba(124, 58, 237, 0.08) !important;
}

html.light .sidebar-main .active-nav-link {
  color: #7C3AED !important;
  background-color: rgba(124, 58, 237, 0.12) !important;
  font-weight: 600 !important;
}

html.light .sidebar-section-title {
  color: #94A3B8 !important;
}

html.light .sidebar-main .border-b,
html.light .sidebar-main .border-t {
  border-color: #F1F5F9 !important;
}

/* Light Mode Topbar Header */
html.light header,
html.light .topbar-header {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid #E5E7EB !important;
}

html.light header h1,
html.light header .text-white {
  color: #0F172A !important;
}

html.light header p,
html.light header .text-gray-400 {
  color: #64748B !important;
}

/* Light Mode Frosted Glass Cards */
html.light .glass-card {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(124, 58, 237, 0.14) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04) !important;
}

html.light .glass-card-hover:hover {
  background: #FFFFFF !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
  box-shadow: 0 14px 38px rgba(124, 58, 237, 0.08) !important;
}

/* Light Mode Typography inside main & cards */
html.light h1:not([class*="gradient-"]),
html.light h2:not([class*="gradient-"]),
html.light h3:not([class*="gradient-"]),
html.light h4:not([class*="gradient-"]),
html.light .main-content h1,
html.light .main-content h2,
html.light .main-content h3,
html.light .main-content h4,
html.light .main-content .text-white:not(button.bg-violet-600 *):not(a.bg-violet-600 *):not(button.bg-gradient-to-r *):not(a.bg-gradient-to-r *):not(button.bg-violet-500 *):not(a.bg-violet-500 *):not(.btn-primary *):not(.neural-hologram-display *):not(.orbiting-badge *):not(.badge-solid *):not(button[class*="bg-violet"] *):not(a[class*="bg-violet-600"] *):not(button[class*="bg-amber"] *):not(a[class*="bg-amber"] *):not(button[class*="bg-emerald"] *):not(a[class*="bg-emerald"] *),
html.light .glass-card .text-white:not(button.bg-violet-600 *):not(a.bg-violet-600 *):not(button.bg-gradient-to-r *):not(a.bg-gradient-to-r *):not(button.bg-violet-500 *):not(a.bg-violet-500 *):not(.btn-primary *):not(.neural-hologram-display *):not(.orbiting-badge *):not(.badge-solid *):not(button[class*="bg-violet"] *):not(a[class*="bg-violet-600"] *):not(button[class*="bg-amber"] *):not(a[class*="bg-amber"] *):not(button[class*="bg-emerald"] *):not(a[class*="bg-emerald"] *),
html.light a.glass-card .text-white {
  color: #0F172A !important;
}

/* Light mode solid colored action buttons - always preserve crisp white text */
html.light button.bg-violet-600,
html.light a.bg-violet-600,
html.light button.bg-violet-500,
html.light a.bg-violet-500,
html.light button[class*="bg-gradient-to-r"],
html.light a[class*="bg-gradient-to-r"],
html.light button.bg-amber-600,
html.light a.bg-amber-600,
html.light button.bg-emerald-600,
html.light a.bg-emerald-600 {
  color: #FFFFFF !important;
}
html.light button.bg-violet-600 *,
html.light a.bg-violet-600 *,
html.light button.bg-violet-500 *,
html.light a.bg-violet-500 *,
html.light button[class*="bg-gradient-to-r"] *,
html.light a[class*="bg-gradient-to-r"] *,
html.light button.bg-amber-600 *,
html.light a.bg-amber-600 *,
html.light button.bg-emerald-600 *,
html.light a.bg-emerald-600 * {
  color: #FFFFFF !important;
}

/* Light mode neutral secondary buttons (e.g. Build Autonomous Agent, Dark/Light toggles) */
html.light a.bg-gray-900\/80,
html.light a.bg-gray-900,
html.light button.bg-gray-800,
html.light button.bg-gray-900 {
  background-color: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}
html.light a.bg-gray-900\/80:hover,
html.light a.bg-gray-900:hover,
html.light button.bg-gray-800:hover,
html.light button.bg-gray-900:hover {
  background-color: #F8FAFC !important;
  border-color: #94A3B8 !important;
}
html.light a.bg-gray-900\/80 *,
html.light a.bg-gray-900 *,
html.light button.bg-gray-800 *,
html.light button.bg-gray-900 * {
  color: #0F172A !important;
}

/* Light Mode Contrast for Tinted Badges, Active Submenus, and Conversation Items */
html.light .bg-violet-600\/10,
html.light a.bg-violet-600\/10,
html.light .bg-violet-500\/10,
html.light .bg-violet-500\/20,
html.light .chat-conv-active {
  background-color: #EDE9FE !important;
  border-color: #DDD6FE !important;
}

html.light .bg-violet-600\/10,
html.light .bg-violet-600\/10 span,
html.light .bg-violet-600\/10 p,
html.light a.bg-violet-600\/10,
html.light a.bg-violet-600\/10 span,
html.light a.bg-violet-600\/10 p,
html.light .chat-conv-active,
html.light .chat-conv-active span,
html.light .chat-conv-active p {
  color: #4C1D95 !important;
  font-weight: 600 !important;
}

html.light .bg-violet-600\/10 span.text-gray-500,
html.light a.bg-violet-600\/10 span.text-gray-500,
html.light .chat-conv-active span.text-gray-500 {
  color: #6D28D9 !important;
  font-weight: 500 !important;
}

html.light .bg-cyan-600\/10,
html.light .bg-cyan-500\/10,
html.light .bg-cyan-500\/20 {
  background-color: #ECFEFF !important;
  border-color: #A5F3FC !important;
  color: #0E7490 !important;
}
html.light .bg-cyan-600\/10 span,
html.light .bg-cyan-500\/10 span {
  color: #0E7490 !important;
}

html.light .bg-emerald-600\/10,
html.light .bg-emerald-500\/10,
html.light .bg-emerald-500\/20 {
  background-color: #ECFDF5 !important;
  border-color: #A7F3D0 !important;
  color: #047857 !important;
}
html.light .bg-emerald-600\/10 span,
html.light .bg-emerald-500\/10 span {
  color: #047857 !important;
}

html.light .bg-amber-600\/10,
html.light .bg-amber-500\/10,
html.light .bg-amber-500\/20 {
  background-color: #FFFBEB !important;
  border-color: #FDE68A !important;
  color: #B45309 !important;
}
html.light .bg-amber-600\/10 span,
html.light .bg-amber-500\/10 span {
  color: #B45309 !important;
}

/* Light Mode Theme Toggle Button */
html.light .theme-toggle-btn {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #1E293B !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}
html.light .theme-toggle-btn i,
html.light .theme-toggle-btn svg {
  color: #1E293B !important;
  stroke: #1E293B !important;
}

/* Header Dropdown Menus (Notifications & Profile) */
.header-dropdown-menu {
  background: rgba(13, 17, 23, 0.96) !important;
  border: 1px solid rgba(124, 58, 237, 0.35) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
  right: 0 !important;
  max-width: calc(100vw - 2rem) !important;
}
#profile-dropdown {
  right: 0 !important;
  min-width: 16rem !important;
}
#notifications-dropdown {
  right: 0 !important;
  max-width: calc(100vw - 2rem) !important;
}
@media (max-width: 640px) {
  #notifications-dropdown {
    right: -3rem !important;
    width: calc(100vw - 2rem) !important;
    max-width: 22rem !important;
  }
}
html.light .header-dropdown-menu {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}
html.light .header-dropdown-menu h4,
html.light .header-dropdown-menu p.text-white,
html.light .header-dropdown-menu .text-white {
  color: #0F172A !important;
}
html.light .header-dropdown-menu a:hover p.text-white,
html.light .header-dropdown-menu a:hover .text-white {
  color: #7C3AED !important;
}
html.light .header-dropdown-menu .text-gray-300 {
  color: #334155 !important;
}
html.light .header-dropdown-menu .text-gray-400 {
  color: #64748B !important;
}
html.light .header-dropdown-menu .text-gray-500 {
  color: #94A3B8 !important;
}
html.light .header-dropdown-menu .border-gray-800,
html.light .header-dropdown-menu .border-gray-800\/80,
html.light .header-dropdown-menu .border-gray-800\/60,
html.light .header-dropdown-menu .divide-gray-800\/60 > * {
  border-color: #F1F5F9 !important;
}
html.light .header-dropdown-menu .bg-gray-900\/40 {
  background-color: #F8FAFC !important;
}
html.light .header-dropdown-menu .hover\:bg-gray-800\/40:hover,
html.light .header-dropdown-menu .hover\:bg-gray-800\/60:hover {
  background-color: #F1F5F9 !important;
}
html.light .header-dropdown-menu .bg-gradient-to-br {
  background: linear-gradient(135deg, #FAF5FF 0%, #F1F5F9 100%) !important;
  border-color: rgba(124, 58, 237, 0.25) !important;
}
html.light .header-dropdown-menu .notif-filter-tab {
  color: #64748B !important;
}
html.light .header-dropdown-menu .notif-filter-tab.active {
  background-color: #EDE9FE !important;
  color: #6D28D9 !important;
}
html.light .header-dropdown-menu .notif-item:hover {
  background-color: #F8FAFC !important;
}
html.light .header-dropdown-menu #unread-count-badge {
  background-color: #EDE9FE !important;
  border-color: #DDD6FE !important;
  color: #6D28D9 !important;
}
html.light .header-dropdown-menu .notif-unread-dot {
  background-color: #7C3AED !important;
}
html.light .header-dropdown-menu .divide-gray-800\/60 > a {
  border-color: #F1F5F9 !important;
}

html.light section .rounded-3xl.border-violet-500\/40 {
  background: linear-gradient(135deg, rgba(245, 243, 255, 0.9) 0%, rgba(236, 254, 255, 0.85) 100%) !important;
  border-color: rgba(124, 58, 237, 0.25) !important;
}

html.light section .rounded-3xl.border-violet-500\/40 h3 {
  color: #0F172A !important;
}

html.light section .rounded-3xl.border-violet-500\/40 p {
  color: #475569 !important;
}

html.light .main-content .text-gray-100,
html.light .main-content .text-gray-200,
html.light .main-content .text-gray-300 {
  color: #334155 !important;
}

html.light .main-content .text-gray-400,
html.light .glass-card .text-gray-400 {
  color: #64748B !important;
}

html.light .main-content .text-gray-500,
html.light .glass-card .text-gray-500 {
  color: #94A3B8 !important;
}

/* Light Mode Panels, Secondary Sidebars & Studio Controls */
html.light .bg-\[\#0D1117\],
html.light .bg-\[\#0D1117\]\/60,
html.light .bg-\[\#0D1117\]\/80,
html.light .bg-\[\#0D1117\]\/90 {
  background-color: rgba(255, 255, 255, 0.88) !important;
  border-color: #E5E7EB !important;
}

html.light .bg-gray-900,
html.light .bg-gray-900\/80,
html.light .bg-gray-900\/90,
html.light .bg-gray-900\/60,
html.light .bg-gray-800,
html.light .bg-gray-800\/80,
html.light .bg-gray-800\/60,
html.light .bg-gray-800\/50,
html.light .bg-gray-800\/40 {
  background-color: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
  color: #334155 !important;
}

html.light .border-gray-800,
html.light .border-gray-800\/80,
html.light .border-gray-800\/60,
html.light .border-gray-700 {
  border-color: #E2E8F0 !important;
}

/* Light Mode Form Inputs & Textareas */
html.light .synapse-input,
html.light input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.light textarea,
html.light select {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #D1D5DB !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #94A3B8 !important;
}

/* Light Mode Tables */
html.light table th {
  color: #64748B !important;
}
html.light table td {
  color: #1E293B !important;
}
html.light table tr,
html.light .divide-gray-800\/60 > * {
  border-color: #E2E8F0 !important;
}

/* Light Mode Chat Studio (ai-chat.html) */
html.light #chat-messages > div > div {
  background-color: #FFFFFF !important;
  color: #1E293B !important;
  border-color: rgba(124, 58, 237, 0.15) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}
html.light #chat-messages p,
html.light #chat-messages span {
  color: #1E293B !important;
}
html.light #chat-messages button {
  background-color: #F1F5F9 !important;
  color: #334155 !important;
  border-color: #E2E8F0 !important;
}
html.light #chat-input {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
}

/* Light Mode Image Studio (ai-image-generator.html) */
html.light #output-canvas-box {
  background-color: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}
html.light #output-canvas-box p,
html.light #output-canvas-box span {
  color: #64748B !important;
}
html.light .style-chip,
html.light .ratio-chip {
  background-color: #F1F5F9 !important;
  color: #475569 !important;
  border-color: #E2E8F0 !important;
}
html.light .style-chip.border-violet-500,
html.light .ratio-chip.border-violet-500 {
  background-color: rgba(124, 58, 237, 0.1) !important;
  color: #7C3AED !important;
  border-color: #7C3AED !important;
}

/* Light Mode Agent Builder (ai-agent-builder.html) */
html.light .canvas-node {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(124, 58, 237, 0.2) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05) !important;
}
html.light .canvas-node p,
html.light .canvas-node span {
  color: #64748B !important;
}

/* Light Mode Landing Page (index.html) */
html.light .glass-card a.text-gray-200,
html.light a.glass-card {
  color: #0F172A !important;
}
html.light header nav a {
  color: #475569 !important;
}
html.light header nav a:hover {
  color: #0F172A !important;
}

#image-display-box,
html.light #image-display-box,
.neural-hologram-display,
html.light .neural-hologram-display {
  background: linear-gradient(180deg, #0F172A 0%, #090D16 100%) !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}
#image-display-box h4,
html.light #image-display-box h4,
.neural-hologram-display .text-white,
html.light .neural-hologram-display .text-white,
.neural-hologram-display span.font-mono,
html.light .neural-hologram-display span.font-mono {
  color: #FFFFFF !important;
}
#image-display-box p,
html.light #image-display-box p,
.neural-hologram-display .text-gray-400,
html.light .neural-hologram-display .text-gray-400 {
  color: #94A3B8 !important;
}
.neural-hologram-display .text-gray-300,
html.light .neural-hologram-display .text-gray-300 {
  color: #CBD5E1 !important;
}

/* Orbiting Badges in Hero Montage */
.orbiting-badge,
html.light .orbiting-badge {
  background-color: #0F172A !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}
.orbiting-badge span,
html.light .orbiting-badge span {
  color: #F8FAFC !important;
}

/* Light Mode Emerald Status Badges in Tables */
html.light .bg-emerald-950\/60 {
  background-color: #ECFDF5 !important;
  border-color: #A7F3D0 !important;
  color: #047857 !important;
}

#workflow-logs,
html.light #workflow-logs {
  background: #080B14 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
#workflow-logs div,
#workflow-logs span,
html.light #workflow-logs div,
html.light #workflow-logs span {
  color: #38BDF8 !important;
}

/* Auth Pages Left Hero Card: keep text and styling crisp in both themes */
.auth-hero-banner,
html.light .auth-hero-banner {
  background: linear-gradient(135deg, rgba(46, 16, 101, 0.7) 0%, #0D1117 60%, rgba(8, 51, 68, 0.5) 100%) !important;
}
.auth-hero-banner h2,
html.light .auth-hero-banner h2 {
  color: #FFFFFF !important;
}
.auth-hero-banner p,
html.light .auth-hero-banner p {
  color: #94A3B8 !important;
}
.auth-hero-banner span,
html.light .auth-hero-banner span {
  color: #E2E8F0 !important;
}
.auth-hero-banner .glass-card,
html.light .auth-hero-banner .glass-card {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(124, 58, 237, 0.35) !important;
  color: #F8FAFC !important;
}
.auth-hero-banner .glass-card span,
html.light .auth-hero-banner .glass-card span {
  color: #F8FAFC !important;
}

/* Auth Pages Container & Layout */
.auth-card-container {
  background: rgba(13, 17, 23, 0.95);
}
html.light .auth-card-container {
  background: #FFFFFF !important;
  border-color: rgba(124, 58, 237, 0.2) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08) !important;
}

/* Auth Pages Right Form Card in Light Mode */
html.light .auth-form-card {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}
html.light .auth-form-card h3 {
  color: #0F172A !important;
}
html.light .auth-form-card p {
  color: #64748B !important;
}
html.light .auth-form-card label {
  color: #334155 !important;
}
html.light .auth-form-card input.synapse-input {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}
html.light .auth-form-card input.synapse-input:focus {
  background-color: #FFFFFF !important;
  border-color: #7C3AED !important;
}
html.light .auth-form-card .social-auth-btn {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
html.light .auth-form-card .social-auth-btn:hover {
  background-color: #F8FAFC !important;
  border-color: #CBD5E1 !important;
}
html.light .auth-form-card .social-auth-btn span {
  color: #0F172A !important;
}
html.light .auth-form-card .social-auth-btn svg.text-white {
  fill: #0F172A !important;
  color: #0F172A !important;
}
html.light .auth-form-card .border-t {
  border-color: #E2E8F0 !important;
}
html.light .auth-form-card span.bg-\[\#0B0F19\] {
  background-color: #FFFFFF !important;
  color: #64748B !important;
}
html.light body.auth-page,
html.light body:has(.auth-card-container) {
  background-color: #F8F9FF !important;
}
html.light .auth-form-card input[type="checkbox"],
html.light input[type="checkbox"] {
  background-color: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  accent-color: #7C3AED !important;
}
html.light .auth-page a.glass-card,
html.light a[href="index.html"].glass-card {
  color: #334155 !important;
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-color: #E2E8F0 !important;
}
html.light .auth-page a.glass-card:hover,
html.light a[href="index.html"].glass-card:hover {
  color: #7C3AED !important;
  background-color: #FFFFFF !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
}
html.light .auth-page button.theme-toggle-btn.glass-card,
html.light .auth-page button.theme-toggle-btn {
  background-color: rgba(255, 255, 255, 0.92) !important;
  color: #334155 !important;
  border-color: #E2E8F0 !important;
}
html.light .auth-page button.theme-toggle-btn:hover {
  color: #7C3AED !important;
  background-color: #FFFFFF !important;
}
html.light .text-violet-400 {
  color: #6D28D9 !important;
}
html.light a.text-violet-400:hover,
html.light .hover\:text-violet-300:hover {
  color: #5B21B6 !important;
}
html.light .text-cyan-400 {
  color: #0891B2 !important;
}
html.light .hover\:text-cyan-300:hover {
  color: #0E7490 !important;
}
html.light .auth-form-card .bg-violet-500\/10 {
  background-color: #EDE9FE !important;
  border-color: #DDD6FE !important;
}
html.light .auth-form-card .bg-emerald-500\/10 {
  background-color: #ECFDF5 !important;
  border-color: #A7F3D0 !important;
}
html.light #pass-strength-container .bg-gray-700\/60 {
  background-color: #E2E8F0 !important;
}


/* ==========================================================================
   Responsive Sidebar & Main Content Layout Engine
   ========================================================================== */

.sidebar-main {
  width: 16rem;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
  .sidebar-main {
    transform: translateX(0) !important;
    width: 16rem !important;
  }
  .main-content {
    margin-left: 16rem !important;
    width: calc(100% - 16rem) !important;
    min-width: 0;
  }
  [dir="rtl"] .sidebar-main {
    left: auto !important;
    right: 0 !important;
    border-right: none !important;
    border-left: 1px solid var(--border-subtle) !important;
  }
  [dir="rtl"] .main-content {
    margin-left: 0 !important;
    margin-right: 16rem !important;
  }

  /* Collapsed state */
  body.sidebar-collapsed .sidebar-main {
    width: 4.5rem !important;
  }
  body.sidebar-collapsed .sidebar-text,
  body.sidebar-collapsed .sidebar-section-title,
  body.sidebar-collapsed .sidebar-badge {
    display: none !important;
  }
  body.sidebar-collapsed .main-content {
    margin-left: 4.5rem !important;
    width: calc(100% - 4.5rem) !important;
  }
  [dir="rtl"] body.sidebar-collapsed .main-content {
    margin-left: 0 !important;
    margin-right: 4.5rem !important;
  }
}

@media (max-width: 1023px) {
  .sidebar-main {
    transform: translateX(-100%) !important;
    width: 16rem !important;
  }
  .sidebar-main.sidebar-open,
  .sidebar-main:not(.-translate-x-full) {
    transform: translateX(0) !important;
  }
  [dir="rtl"] .sidebar-main {
    transform: translateX(100%) !important;
    left: auto !important;
    right: 0 !important;
  }
  [dir="rtl"] .sidebar-main.sidebar-open,
  [dir="rtl"] .sidebar-main:not(.-translate-x-full) {
    transform: translateX(0) !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* RTL Global Support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .sidebar-left {
  left: auto;
  right: 0;
}

/* ==========================================================================
   Global Quick Search Modal (Dark + Light Mode Engine)
   ========================================================================== */

#search-modal {
  z-index: 99999;
}

#search-modal .glass-card {
  background: rgba(13, 17, 23, 0.94);
  border: 1px solid rgba(124, 58, 237, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(124, 58, 237, 0.2);
}

#search-modal .search-item {
  color: #E2E8F0;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

#search-modal .search-item:hover,
#search-modal .search-item.selected {
  background-color: rgba(124, 58, 237, 0.2) !important;
  color: #FFFFFF !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
}

/* Light Mode Overrides for Search Modal */
html.light #search-modal .glass-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(124, 58, 237, 0.25) !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 25px rgba(124, 58, 237, 0.12) !important;
}

html.light #search-modal input#search-input {
  color: #0F172A !important;
}

html.light #search-modal input#search-input::placeholder {
  color: #94A3B8 !important;
}

html.light #search-modal .border-b,
html.light #search-modal .border-t {
  border-color: #E2E8F0 !important;
}

html.light #search-modal .search-category-title {
  color: #64748B !important;
}

html.light #search-modal .search-item {
  color: #1E293B !important;
}

html.light #search-modal .search-item .search-meta {
  color: #64748B !important;
}

html.light #search-modal .search-item:hover,
html.light #search-modal .search-item.selected {
  background-color: #EDE9FE !important;
  color: #6D28D9 !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
}

html.light #search-modal .search-item:hover .search-meta,
html.light #search-modal .search-item.selected .search-meta {
  color: #7C3AED !important;
}

html.light #search-modal .bg-gray-900\/60,
html.light #search-modal .bg-gray-800 {
  background-color: #F1F5F9 !important;
  color: #475569 !important;
  border-color: #CBD5E1 !important;
}

html.light #search-modal kbd {
  background-color: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #CBD5E1 !important;
}

/* ==========================================================================
   Documentation Center & Theme Toggle UI Engine
   ========================================================================== */

/* Universal Theme Toggle Sun/Moon Icon Handlers */
html.light .theme-toggle-btn [data-lucide="moon"] {
  display: none !important;
}
html.light .theme-toggle-btn [data-lucide="sun"] {
  display: block !important;
}
html.dark .theme-toggle-btn [data-lucide="moon"] {
  display: block !important;
}
html.dark .theme-toggle-btn [data-lucide="sun"] {
  display: none !important;
}

/* Documentation Layout Engine */
.doc-section {
  scroll-margin-top: 5.5rem;
}

@media (min-width: 1024px) {
  .lg\:flex-row {
    flex-direction: row !important;
  }
  .lg\:w-72 {
    width: 18rem !important;
    flex-shrink: 0 !important;
  }
  .lg\:w-64 {
    width: 16rem !important;
    flex-shrink: 0 !important;
  }
  .lg\:gap-12 {
    gap: 3rem !important;
  }
  .lg\:py-10 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  .lg\:px-12 {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
  .lg\:sticky {
    position: sticky !important;
  }
  .lg\:top-24 {
    top: 6rem !important;
  }
}

.doc-sidebar-sticky {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.doc-sidebar-sticky::-webkit-scrollbar {
  width: 4px;
}
.doc-sidebar-sticky::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.2);
  border-radius: 4px;
}

.doc-toc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94A3B8;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}
.doc-toc-link:hover {
  color: #FFFFFF;
  background-color: rgba(124, 58, 237, 0.12);
  border-left-color: #A78BFA;
}
.doc-toc-link.active {
  color: #FFFFFF;
  background-color: rgba(124, 58, 237, 0.2);
  border-left-color: #7C3AED;
  font-weight: 600;
}

/* Documentation Code Box */
.doc-code-box {
  background-color: #0A0D18;
  border: 1px solid #1E2640;
  border-radius: 0.875rem;
  overflow: hidden;
}
.doc-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background-color: #0E1322;
  border-bottom: 1px solid #1E2640;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: #94A3B8;
}
.doc-code-pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #E2E8F0;
}

/* Documentation in Light Mode */
html.light body.doc-page {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
}
html.light .doc-header {
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: #E2E8F0 !important;
}
html.light .doc-header a,
html.light .doc-header span {
  color: #0F172A !important;
}
html.light .doc-sidebar .glass-card,
html.light .doc-card,
html.light .doc-main .glass-card {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05) !important;
}
html.light .doc-toc-link {
  color: #64748B !important;
}
html.light .doc-toc-link:hover {
  color: #7C3AED !important;
  background-color: rgba(124, 58, 237, 0.08) !important;
  border-left-color: #7C3AED !important;
}
html.light .doc-toc-link.active {
  color: #6D28D9 !important;
  background-color: rgba(124, 58, 237, 0.12) !important;
  border-left-color: #7C3AED !important;
}
html.light .doc-page h1,
html.light .doc-page h2,
html.light .doc-page h3,
html.light .doc-page h4 {
  color: #0F172A !important;
}
html.light .doc-page p,
html.light .doc-page li {
  color: #334155 !important;
}
html.light .doc-code-box {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
}
html.light .doc-code-header {
  background-color: #1E293B !important;
  border-bottom-color: #334155 !important;
  color: #94A3B8 !important;
}
html.light .doc-code-pre {
  color: #F1F5F9 !important;
}
html.light .doc-page code:not(.doc-code-pre code) {
  background-color: #EDE9FE !important;
  color: #6D28D9 !important;
  border: 1px solid #DDD6FE !important;
}


