/* UNIVERSAL STYLES v3.1 - MODERN UI ARCHITECTURE */

:root {
  /* Core Palette (2026 Deep Space) */
  --bg-dark: #030712;
  --bg-card: rgba(17, 24, 39, 0.4);
  --bg-card-hover: rgba(31, 41, 55, 0.6);
  --bg-surface-light: rgba(255, 255, 255, 0.02);
  --bg-surface-heavy: rgba(3, 7, 18, 0.85);

  /* Typography Hierarchy */
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Brand Colors (2026 Gradient System) */
  --primary: #818cf8; /* Indigo 400 */
  --primary-glow: rgba(129, 140, 248, 0.4);
  --secondary: #c084fc; /* Purple 400 */
  --accent: #38bdf8; /* Sky 400 */
  --gradient-main: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);

  /* UI Effects */
  --border-light: 1px solid rgba(255, 255, 255, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --inner-glow: inset 0 0 20px rgba(255, 255, 255, 0.02);

  /* Dimensions & Spacing */
  --radius-xl: 1.5rem;
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --header-height: 72px;

  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Animation System */
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Light Theme Overrides */
body.light-theme {
  --bg-dark: #f9fafb;
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-card-hover: rgba(255, 255, 255, 0.85);
  --bg-surface-light: rgba(0, 0, 0, 0.03);
  --bg-surface-heavy: rgba(255, 255, 255, 0.85);
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-dim: #9ca3af;
  --border-light: 1px solid rgba(0, 0, 0, 0.06);
  --inner-glow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

/* Reset & Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text-main);
  background: var(--bg-dark);
  font-family: var(--font-body);
  padding-top: var(--header-height);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll from sidebar */
  overflow-y: auto;   /* Force vertical scroll */
}

html {
  scroll-behavior: smooth;
  overflow-y: auto;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ------------------------------------------- */
/* HEADER (Fixed)                              */
/* ------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: var(--border-light);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.nav-container {
  width: 100%;
  max-width: 1400px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  transition: all 0.3s var(--ease-smooth);
}

.site-logo:hover {
  transform: translateY(-1px);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all 0.3s var(--ease-elastic);
}

.site-logo:hover .logo-icon {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s var(--ease-smooth);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-main);
  transition: width 0.3s var(--ease-smooth);
}

.nav-links a:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-controls button {
  background: var(--bg-card);
  border: var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.625rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-elastic);
  width: 44px;
  height: 44px;
}

.nav-controls button:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-controls button:active {
  transform: translateY(0) scale(0.95);
}

/* ------------------------------------------- */
/* FOOTER (Enhanced)                          */
/* ------------------------------------------- */
.site-footer {
  margin-top: auto;
  padding: 6rem 0 2.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  border-top: var(--border-light);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: var(--gradient-main);
  opacity: 0.6;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.footer-col h4 {
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--gradient-main);
  border-radius: 1px;
}

.footer-col p {
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 320px;
  margin: 0;
  font-size: 0.95rem;
}

.footer-col a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 0.875rem;
  transition: all 0.3s var(--ease-smooth);
  font-size: 0.9rem;
  position: relative;
  padding-left: 0;
}

.footer-col a::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s var(--ease-smooth);
}

.footer-col a:hover {
  color: var(--primary);
  transform: translateX(8px);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.footer-col a:hover::before {
  opacity: 1;
}

.site-copyright {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.875rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.03);
  font-weight: 500;
}

/* ------------------------------------------- */
/* UTILITIES & ANIMATIONS                     */
/* ------------------------------------------- */

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px var(--primary-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--primary-glow);
  }
}

/* Utility Classes */
.fade-in-up {
  animation: fadeInUp 0.8s var(--ease-elastic);
}

.pulse {
  animation: pulse 2s infinite;
}

.glow {
  animation: glow 3s ease-in-out infinite;
}

/* Focus Management */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection Styling */
::selection {
  background: var(--primary-glow);
  color: var(--text-main);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-surface-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

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

/* ------------------------------------------- */
/* RESPONSIVE DESIGN (Mobile-First)           */
/* ------------------------------------------- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .footer-col p {
    margin: 0 auto;
  }

  .footer-col h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  main {
    padding: 0 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .site-logo {
    font-size: 1.1rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .site-footer {
    padding: 4rem 0 2rem;
  }
}

/* ------------------------------------------- */
/* ACCESSIBILITY & PERFORMANCE                */
/* ------------------------------------------- */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-light: 2px solid rgba(255, 255, 255, 0.3);
    --text-muted: #d1d5db;
  }
}

/* Dark Mode Preference */
@media (prefers-color-scheme: light) {
  :root {
    --bg-dark: #f9fafb;
    --text-main: #111827;
  }
}
