/**
 * Learn With Bhanu
 * Enhanced Design System & High-Contrast Dark Mode CSS
 * Ensures 100% readability across Light & Dark themes
 */

:root {
  --color-surface: #f8fafc;
  --color-surface-dim: #e2e8f0;
  --color-surface-bright: #ffffff;
  --color-surface-lowest: #ffffff;
  --color-surface-low: #f1f5f9;
  --color-surface-high: #e2e8f0;
  --color-on-surface: #0f172a;
  --color-on-surface-variant: #475569;
  --color-primary: #0f172a;
  --color-on-primary: #ffffff;
  --color-secondary: #b51822;
  --color-outline-variant: #cbd5e1;
  --theme-oracle: #b51822;
  --theme-ai: #1d4ed8;
  --theme-devops: #0f766e;
}

/* Global Dark Mode Overrides for High-Contrast Readability */
html.dark {
  --color-surface: #0b0f17;
  --color-surface-dim: #070a10;
  --color-surface-bright: #131922;
  --color-surface-lowest: #141b24;
  --color-surface-low: #1a222e;
  --color-surface-high: #242f3d;
  --color-on-surface: #ffffff;
  --color-on-surface-variant: #cbd5e1;
  --color-primary: #ffffff;
  --color-on-primary: #0b0f17;
  --color-secondary: #ff4d5a;
  --color-outline-variant: #2d3748;
}

/* Base resets & typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

html.dark body {
  background-color: #0b0f17 !important;
  color: #ffffff !important;
}

/* Fix any invisible or washed out text in Dark Mode */
html.dark .text-on-surface {
  color: #ffffff !important;
}

html.dark .text-on-surface-variant {
  color: #cbd5e1 !important;
}

html.dark .bg-white {
  background-color: #141b24 !important;
}

html.dark .bg-surface-container-low {
  background-color: #1a222e !important;
}

html.dark .bg-surface-container-lowest {
  background-color: #141b24 !important;
}

html.dark .border-outline-variant,
html.dark .border-outline-variant\/20,
html.dark .border-outline-variant\/30,
html.dark .border-outline-variant\/40,
html.dark .border-outline-variant\/60 {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html.dark input, 
html.dark select, 
html.dark textarea {
  background-color: #141b24 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

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

/* Hero background pattern */
.hero-pattern {
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
}

html.dark .hero-pattern {
  background-image: radial-gradient(#334155 1px, transparent 1px);
}

/* Nav links underline animation */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #b51822;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark .nav-link::after {
  background-color: #ff4d5a;
}

.nav-link:hover::after,
.nav-link.nav-active::after {
  width: 100%;
}

/* Card hover & elevation styles */
.card-hover {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0px 14px 32px rgba(0, 0, 0, 0.08);
}

html.dark .card-hover:hover {
  box-shadow: 0px 14px 32px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Shadow tokens */
.shadow-level-1 {
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

.shadow-level-2 {
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.08);
}

html.dark .shadow-level-1 {
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.4);
}

html.dark .shadow-level-2 {
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.6);
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Animated Pulse Dot */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.15); }
}

.pulse-dot {
  animation: pulse-subtle 2.5s infinite ease-in-out;
}

/* Modal Transition */
.modal-backdrop {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.25s ease-out;
}

.modal-content {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
}

/* Toast alert animations */
@keyframes toast-in {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

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

/* Code block highlight container */
pre {
  position: relative;
}

.copy-btn {
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.copy-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}
