/* The IT Loop - Production Multi-Theme Stylesheet (Light & Dark Mode) */
@layer base {
  body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
  }

  code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace;
  }
}

/* Glassmorphism Styles - Dark Theme Default */
.glass-card {
  position: relative;
  background: rgba(13, 27, 42, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

.glass-card-cyan:hover {
  border-color: rgba(0, 194, 255, 0.4);
  box-shadow: 0 0 35px -5px rgba(0, 194, 255, 0.2);
}

.glass-card-magenta:hover {
  border-color: rgba(217, 0, 143, 0.4);
  box-shadow: 0 0 35px -5px rgba(217, 0, 143, 0.2);
}

.glass-card-amber:hover {
  border-color: rgba(255, 138, 0, 0.4);
  box-shadow: 0 0 35px -5px rgba(255, 138, 0, 0.2);
}

.glass-card-teal:hover {
  border-color: rgba(0, 229, 153, 0.4);
  box-shadow: 0 0 35px -5px rgba(0, 229, 153, 0.2);
}

.glass-card-rainbow:hover {
  border-color: rgba(0, 194, 255, 0.4);
  box-shadow: 0 0 40px -5px rgba(0, 194, 255, 0.25), 0 0 40px -5px rgba(217, 0, 143, 0.2);
}

/* =========================================================
   LIGHT MODE OVERRIDES & REFINEMENTS
   ========================================================= */
html:not(.dark),
html.light,
[data-theme="light"] {
  color-scheme: light;
}

html:not(.dark) body,
html.light body,
[data-theme="light"] body {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
}

/* Background overrides in light mode */
html:not(.dark) .bg-\[\#070B14\],
html.light .bg-\[\#070B14\],
[data-theme="light"] .bg-\[\#070B14\] {
  background-color: #F8FAFC !important;
}

html:not(.dark) .bg-\[\#0A1128\],
html.light .bg-\[\#0A1128\],
[data-theme="light"] .bg-\[\#0A1128\] {
  background-color: #FFFFFF !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

html:not(.dark) .bg-\[\#0D1B2A\],
html.light .bg-\[\#0D1B2A\],
[data-theme="light"] .bg-\[\#0D1B2A\] {
  background-color: #F1F5F9 !important;
}

html:not(.dark) .bg-white\/5,
html.light .bg-white\/5,
[data-theme="light"] .bg-white\/5 {
  background-color: rgba(15, 23, 42, 0.04) !important;
}

html:not(.dark) .bg-white\/10,
html.light .bg-white\/10,
[data-theme="light"] .bg-white\/10 {
  background-color: rgba(15, 23, 42, 0.07) !important;
}

html:not(.dark) .bg-white\/15,
html.light .bg-white\/15,
[data-theme="light"] .bg-white\/15,
html:not(.dark) .bg-white\/20,
html.light .bg-white\/20,
[data-theme="light"] .bg-white\/20 {
  background-color: rgba(15, 23, 42, 0.1) !important;
}

html:not(.dark) .bg-black\/40,
html.light .bg-black\/40,
[data-theme="light"] .bg-black\/40,
html:not(.dark) .bg-black\/60,
html.light .bg-black\/60,
[data-theme="light"] .bg-black\/60 {
  background-color: #F1F5F9 !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) .bg-slate-800,
html.light .bg-slate-800,
[data-theme="light"] .bg-slate-800 {
  background-color: #E2E8F0 !important;
}

/* Borders in light mode */
html:not(.dark) .border-white\/5,
html.light .border-white\/5,
html:not(.dark) .border-white\/10,
html.light .border-white\/10,
html:not(.dark) .border-white\/15,
html.light .border-white\/15,
html:not(.dark) .border-white\/20,
html.light .border-white\/20,
html:not(.dark) .border-white\/30,
html.light .border-white\/30 {
  border-color: rgba(15, 23, 42, 0.1) !important;
}

/* Glass cards & panels in light mode */
html:not(.dark) .glass-card,
html.light .glass-card,
html:not(.dark) .glass-panel,
html.light .glass-panel,
html:not(.dark) .glass-panel-hover,
html.light .glass-panel-hover {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05) !important;
}

html:not(.dark) .glass-card:hover,
html.light .glass-card:hover,
html:not(.dark) .glass-panel-hover:hover,
html.light .glass-panel-hover:hover {
  border-color: rgba(15, 23, 42, 0.2) !important;
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.1) !important;
}

html:not(.dark) .glass-card-cyan:hover,
html.light .glass-card-cyan:hover {
  border-color: rgba(0, 194, 255, 0.5) !important;
  box-shadow: 0 15px 35px -5px rgba(0, 194, 255, 0.15) !important;
}

html:not(.dark) .glass-card-magenta:hover,
html.light .glass-card-magenta:hover {
  border-color: rgba(217, 0, 143, 0.5) !important;
  box-shadow: 0 15px 35px -5px rgba(217, 0, 143, 0.15) !important;
}

html:not(.dark) .glass-card-amber:hover,
html.light .glass-card-amber:hover {
  border-color: rgba(255, 138, 0, 0.5) !important;
  box-shadow: 0 15px 35px -5px rgba(255, 138, 0, 0.15) !important;
}

html:not(.dark) .glass-card-teal:hover,
html.light .glass-card-teal:hover {
  border-color: rgba(0, 229, 153, 0.5) !important;
  box-shadow: 0 15px 35px -5px rgba(0, 229, 153, 0.15) !important;
}

/* =========================================================
   LIGHT MODE TYPOGRAPHY & ZERO DISAPPEARING TEXT ENGINE
   ========================================================= */

/* Headings and default high-level elements */
html:not(.dark) h1,
html.light h1,
html:not(.dark) h2,
html.light h2,
html:not(.dark) h3,
html.light h3,
html:not(.dark) h4,
html.light h4,
html:not(.dark) h5,
html.light h5,
html:not(.dark) h6,
html.light h6 {
  color: #0F172A;
}

/* High contrast text overrides */
html:not(.dark) .text-white,
html.light .text-white {
  color: #0F172A !important;
}

html:not(.dark) .text-slate-100,
html.light .text-slate-100,
html:not(.dark) .text-gray-100,
html.light .text-gray-100 {
  color: #0F172A !important;
}

html:not(.dark) .text-slate-200,
html.light .text-slate-200,
html:not(.dark) .text-gray-200,
html.light .text-gray-200 {
  color: #1E293B !important;
}

html:not(.dark) .text-slate-300,
html.light .text-slate-300,
html:not(.dark) .text-gray-300,
html.light .text-gray-300 {
  color: #334155 !important;
}

html:not(.dark) .text-slate-400,
html.light .text-slate-400,
html:not(.dark) .text-gray-400,
html.light .text-gray-400 {
  color: #475569 !important;
}

html:not(.dark) .text-slate-500,
html.light .text-slate-500,
html:not(.dark) .text-gray-500,
html.light .text-gray-500 {
  color: #64748B !important;
}

/* Handle opacity-modified text classes */
html:not(.dark) [class*="text-white"][class*="opacity-"],
html.light [class*="text-white"][class*="opacity-"],
html:not(.dark) .text-opacity-95,
html.light .text-opacity-95,
html:not(.dark) .text-opacity-90,
html.light .text-opacity-90,
html:not(.dark) .text-opacity-80,
html.light .text-opacity-80,
html:not(.dark) .text-opacity-70,
html.light .text-opacity-70 {
  color: #0F172A !important;
  opacity: 1 !important;
}

/* Ensure vibrant gradient text renders properly with no clipping issues */
html:not(.dark) .bg-clip-text,
html.light .bg-clip-text,
html:not(.dark) [class*="bg-clip-text"],
html.light [class*="bg-clip-text"] {
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* Specific protection for buttons, pills and action links with solid or vibrant gradient backgrounds */
html:not(.dark) button.bg-gradient-to-r,
html.light button.bg-gradient-to-r,
html:not(.dark) a.bg-gradient-to-r,
html.light a.bg-gradient-to-r,
html:not(.dark) button[class*="bg-gradient-"],
html.light button[class*="bg-gradient-"],
html:not(.dark) a[class*="bg-gradient-"],
html.light a[class*="bg-gradient-"],
html:not(.dark) .btn-primary,
html.light .btn-primary,
html:not(.dark) .keep-text-white,
html.light .keep-text-white,
html:not(.dark) .btn-text-white,
html.light .btn-text-white {
  color: #FFFFFF !important;
}

html:not(.dark) button[class*="bg-gradient-"] span:not(.bg-clip-text),
html.light button[class*="bg-gradient-"] span:not(.bg-clip-text),
html:not(.dark) a[class*="bg-gradient-"] span:not(.bg-clip-text),
html.light a[class*="bg-gradient-"] span:not(.bg-clip-text),
html:not(.dark) button[class*="bg-gradient-"] svg,
html.light button[class*="bg-gradient-"] svg,
html:not(.dark) a[class*="bg-gradient-"] svg,
html.light a[class*="bg-gradient-"] svg,
html:not(.dark) .keep-text-white *,
html.light .keep-text-white * {
  color: #FFFFFF !important;
}

/* Inputs & Form Controls in light mode */
html:not(.dark) input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
html.light input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html.light select,
html:not(.dark) textarea,
html.light textarea {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

html:not(.dark) select option,
html.light select option {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
}

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

/* Navbar in light mode */
html:not(.dark) #main-navbar,
html.light #main-navbar {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

html:not(.dark) #main-navbar.scrolled-nav,
html.light #main-navbar.scrolled-nav {
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.12), 0 0 15px rgba(0, 194, 255, 0.08) !important;
}

html:not(.dark) #main-navbar a:not([class*="bg-gradient"]),
html.light #main-navbar a:not([class*="bg-gradient"]) {
  color: #334155 !important;
}

html:not(.dark) #main-navbar a:not([class*="bg-gradient"]):hover,
html.light #main-navbar a:not([class*="bg-gradient"]):hover {
  color: #0091FF !important;
}

/* Mobile dropdown menu in light mode */
html:not(.dark) #mobile-menu,
html.light #mobile-menu {
  background-color: #FFFFFF !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15) !important;
}

html:not(.dark) #mobile-menu a:not([class*="bg-gradient"]),
html.light #mobile-menu a:not([class*="bg-gradient"]) {
  color: #1E293B !important;
}

/* Brand Logo Icon background in light mode */
html:not(.dark) .brand-icon-bg,
html.light .brand-icon-bg {
  background-color: #070B14 !important;
}

html:not(.dark) .brand-icon-bg svg,
html.light .brand-icon-bg svg {
  color: #FFFFFF !important;
}

/* Chat widget in light mode */
html:not(.dark) #chat-box,
html.light #chat-box {
  background-color: #FFFFFF !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15) !important;
}

html:not(.dark) #chat-box .bot-message,
html.light #chat-box .bot-message {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) #chat-box .user-message,
html.light #chat-box .user-message {
  background-color: #00C2FF !important;
  color: #FFFFFF !important;
}

html:not(.dark) #chat-box .suggestion-btn,
html.light #chat-box .suggestion-btn {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

html:not(.dark) #chat-box .suggestion-btn:hover,
html.light #chat-box .suggestion-btn:hover {
  background-color: #F1F5F9 !important;
  border-color: #00C2FF !important;
  color: #0091FF !important;
}

/* Cost Calculator in light mode */
html:not(.dark) #calc-total-monthly,
html.light #calc-total-monthly {
  color: #0F172A !important;
}

html:not(.dark) #calc-seats-val,
html.light #calc-seats-val,
html:not(.dark) #calc-servers-val,
html.light #calc-servers-val {
  background-color: rgba(0, 194, 255, 0.08) !important;
  border-color: rgba(0, 194, 255, 0.3) !important;
  color: #0088FF !important;
}

/* Footer in light mode */
html:not(.dark) footer,
html.light footer {
  background-color: #F1F5F9 !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) footer a:not([class*="bg-gradient"]),
html.light footer a:not([class*="bg-gradient"]) {
  color: #475569 !important;
}

html:not(.dark) footer a:not([class*="bg-gradient"]):hover,
html.light footer a:not([class*="bg-gradient"]):hover {
  color: #0091FF !important;
}

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

::-webkit-scrollbar-track {
  background: #070B14;
}

html:not(.dark) ::-webkit-scrollbar-track,
html.light ::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

html:not(.dark) ::-webkit-scrollbar-thumb,
html.light ::-webkit-scrollbar-thumb {
  background: #CBD5E1;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 194, 255, 0.4);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Range input slider styling */
input[type=range] {
  -webkit-appearance: none;
  background: #1e293b;
  border-radius: 9999px;
}

html:not(.dark) input[type=range],
html.light input[type=range] {
  background: #E2E8F0;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.5);
  border: 2px solid #00C2FF;
  transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
  position: relative;
  display: inline-flex;
  items-center: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}
