/* ==========================================================================
   PORTFOLIO_OS / VER 2.4 - DESIGN SYSTEM VARIABLES (CYBER SENTINEL THEME)
   ========================================================================== */

:root {
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Tokens: Default Dark Mode */
  --background: #0f1418;
  --on-background: #dee3e8;
  
  --primary: #8ed5ff;
  --on-primary: #00354a;
  --primary-container: #38bdf8;
  --on-primary-container: #004965;
  
  --secondary: #bdc2ff;
  --on-secondary: #131e8c;
  --secondary-container: #2f3aa3;
  --on-secondary-container: #a8afff;

  --tertiary: #ffc176;
  --on-tertiary: #472a00;
  --tertiary-container: #f1a02b;
  --on-tertiary-container: #613b00;

  --surface: #0f1418;
  --on-surface: #dee3e8;
  --surface-variant: #303539;
  --on-surface-variant: #bdc8d1;

  --surface-container-lowest: #0a0f12;
  --surface-container-low: #171c20;
  --surface-container: #1b2024;
  --surface-container-high: #252b2e;
  --surface-container-highest: #303539;
  
  --surface-bright: #343a3e;
  --surface-dim: #0f1418;
  
  --inverse-surface: #dee3e8;
  --inverse-on-surface: #2c3135;
  --inverse-primary: #00668a;
  
  --outline: #87929a;
  --outline-variant: #3e484f;

  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;

  /* Corner Radius */
  --radius: 0.5rem;
  
  /* Animations */
  --glow-color: rgba(142, 213, 255, 0.4);
}

/* Light Mode Overrides (when HTML does not have .dark) */
html:not(.dark) {
  --background: #f3f4f6;
  --on-background: #0f172a;
  
  --primary: #0284c7;
  --on-primary: #ffffff;
  --primary-container: #e0f2fe;
  --on-primary-container: #0369a1;
  
  --secondary: #4f46e5;
  --on-secondary: #ffffff;
  --secondary-container: #e0e7ff;
  --on-secondary-container: #3730a3;

  --tertiary: #d97706;
  --on-tertiary: #ffffff;
  --tertiary-container: #fef3c7;
  --on-tertiary-container: #92400e;

  --surface: #ffffff;
  --on-surface: #0f172a;
  --surface-variant: #e2e8f0;
  --on-surface-variant: #475569;

  --surface-container-lowest: #ffffff;
  --surface-container-low: #f8fafc;
  --surface-container: #f1f5f9;
  --surface-container-high: #e2e8f0;
  --surface-container-highest: #cbd5e1;
  
  --surface-bright: #ffffff;
  --surface-dim: #f1f5f9;
  
  --inverse-surface: #0f172a;
  --inverse-on-surface: #f8fafc;
  --inverse-primary: #0284c7;
  
  --outline: #94a3b8;
  --outline-variant: #cbd5e1;

  --error: #dc2626;
  --on-error: #ffffff;
  --error-container: #fee2e2;
  --on-error-container: #991b1b;
  
  --glow-color: rgba(2, 132, 199, 0.2);
}

/* ==========================================================================
   GLOBAL STYLE SETUPS
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--on-background);
  overflow-x: hidden;
  font-family: var(--font-sans);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

::-webkit-scrollbar-track {
  background: var(--surface-container-lowest);
}

::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Custom Selection style */
::selection {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

/* ==========================================================================
   CYBERPUNK VISUAL EFFECTS & COMPONENT SPECIFICS
   ========================================================================== */

/* Scanline Overlay (Low Opacity Grid Style) */
.scanline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.04) 50%), 
              linear-gradient(90deg, rgba(255, 0, 0, 0.003), rgba(0, 255, 0, 0.002), rgba(0, 0, 255, 0.003));
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
  z-index: 100;
}

/* Glassmorphism Card Component */
.glass-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--outline-variant);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

html:not(.dark) .glass-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
}

.glass-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--glow-color);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
}

html:not(.dark) .glass-card:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Project Cards Image Hover effect */
.glass-card:hover .project-image {
  transform: scale(1.05);
}

.project-image-wrapper {
  background-color: var(--surface-container-low);
}

/* Interactive Cursor Spotlight Glow Effect for Cards */
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(300px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
              rgba(142, 213, 255, 0.06),
              transparent 50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

html:not(.dark) .glass-card::before {
  background: radial-gradient(200px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
              rgba(2, 132, 199, 0.04),
              transparent 50%);
}

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

/* Navigation Links Text Glow */
.glow-sm:hover {
  text-shadow: 0 0 8px var(--glow-color);
}

/* Material Symbols Icon Configuration */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Status Badge Pulse Animation */
@keyframes pulse-soft {
  0%, 100% { 
    opacity: 1; 
    box-shadow: 0 0 4px var(--primary);
  }
  50% { 
    opacity: 0.6; 
    box-shadow: 0 0 12px var(--primary);
  }
}

.animate-pulse-soft {
  animation: pulse-soft 3s infinite;
}

/* ==========================================================================
   DYNAMIC TOAST NOTIFICATION STYLING
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface-container-high);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 1000;
  transform: translateY(150%) scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ==========================================================================
   THEME TOGGLE BUTTON & LABEL ANIMATIONS
   ========================================================================== */

/* Active/Inactive state transitions for label texts */
html:not(.dark) .theme-toggle-label-light {
  color: var(--primary);
  opacity: 1;
  text-shadow: 0 0 8px var(--glow-color);
}
html:not(.dark) .theme-toggle-label-dark {
  opacity: 0.35;
}
html.dark .theme-toggle-label-light {
  opacity: 0.35;
}
html.dark .theme-toggle-label-dark {
  color: var(--primary);
  opacity: 1;
  text-shadow: 0 0 8px var(--glow-color);
}

/* Button hover scaling */
.theme-toggle-btn {
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--glow-color);
}

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

.theme-toggle-btn.toggled {
  animation: buttonBounce 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes buttonBounce {
  0% { transform: scale(1); }
  25% { transform: scale(0.7) rotate(-15deg); }
  50% { transform: scale(1.25) rotate(15deg); }
  75% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1); }
}

/* Morphing Icon Transitions */
.theme-toggle-btn .sun-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.theme-toggle-btn .moon-icon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
}

/* Sun hides and spins when toggled to Light mode (not dark) */
html:not(.dark) .theme-toggle-btn .sun-icon {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}

/* Moon appears and spins to center when toggled to Light mode (not dark) */
html:not(.dark) .theme-toggle-btn .moon-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

/* Sun spins slightly on button hover in Dark mode */
html.dark .theme-toggle-btn:hover .sun-icon {
  transform: rotate(45deg) scale(1.1);
}

/* Moon spins slightly on button hover in Light mode */
html:not(.dark) .theme-toggle-btn:hover .moon-icon {
  transform: rotate(-30deg) scale(1.1);
}

/* Adjust timeline details for education */
.timeline-dot {
  box-shadow: 0 0 8px var(--glow-color);
}

/* ==========================================================================
   THEME SWITCH TRANSITION EFFECTS
   ========================================================================== */

/* Smooth CSS transition overrides for theme switching */
body, header, nav, footer, .glass-card, button, input, textarea, a, h1, h2, h3, p, span, label {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* Disable transitions on all elements during theme switch to prevent styling lag */
.theme-transitioning,
.theme-transitioning * {
  transition: none !important;
}

/* Custom View Transition pseudo-element styling for theme reveal */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

/* Theme Sweep Overlay container */
.theme-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), var(--primary), transparent 60%);
  opacity: 0;
}

.theme-transition.active {
  animation: themeSweep 0.6s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
}

@keyframes themeSweep {
  0% {
    opacity: 0;
    transform: scale(0.1);
  }
  30% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: scale(3.5);
  }
}