/* 1. Theme Variables & Base */
:root {
  --brand-bg: #050505;
  --brand-nav: #0a0a0a;
  --brand-footer: #080808;
  --brand-text: #e5e5e5;
  
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Playfair Display", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

.bg-sky-500 { background-color: #0ea5e9 !important; }
.bg-red-600 { background-color: #dc2626 !important; }
.bg-blue-700 { background-color: #1d4ed8 !important; }
.bg-green-600 { background-color: #16a34a !important; }
.bg-pink-600 { background-color: #db2777 !important; }
.bg-orange-600 { background-color: #ea580c !important; }
.bg-blue-600 { background-color: #2563eb !important; }
.bg-indigo-500 { background-color: #6366f1 !important; }
.bg-emerald-500 { background-color: #10b981 !important; }
.bg-rose-500 { background-color: #f43f5e !important; }
.bg-zinc-800 { background-color: #27272a !important; }
.bg-blue-900 { background-color: #1e3a8a !important; }
.bg-slate-800 { background-color: #1e293b !important; }
.bg-teal-600 { background-color: #0d9488 !important; }
.bg-rose-500 { background-color: #f43f5e !important; }
.bg-emerald-600 { background-color: #059669 !important; }
.bg-amber-500 { background-color: #f59e0b !important; }

body {
  background-color: var(--brand-bg);
  color: var(--brand-text);
  overflow-x: hidden;
}

/* 2. Navigation Underline Effect */
.nav-link-underline {
  position: relative;
}

.nav-link-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 1px;
  width: 0;
  background-color: white;
  transition: width 0.3s ease;
}

.nav-link-underline:hover::after,
.nav-link-underline.active::after {
  width: 100%;
}

/* 3. Glow & Interaction Effects */
.glow-hover:hover {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.glow-on-click:active {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
  transform: scale(0.95);
  transition: transform 0.1s, box-shadow 0.1s;
}

/* 4. Marquee Animation */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  display: flex;
  animation: marquee 30s linear infinite;
  width: max-content;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

/* 5. Custom Floating Animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* 6. Dropdown & Overlay States */
#dropdown-overlay {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#dropdown-overlay.show {
  display: block;
  opacity: 1;
}

#dropdown-menu {
  display: none;
  opacity: 0;
  transform: translate(-50%, -20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* SCROLL FIXES HERE */
  max-height: 85vh;          /* Limits height to 85% of screen */
  overflow-y: auto;          /* Enables vertical scrolling */
  scrollbar-width: thin;     /* Firefox scrollbar styling */
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#dropdown-menu.show {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* Custom Scrollbar for Chrome/Safari */
#dropdown-menu::-webkit-scrollbar {
  width: 6px;
}
#dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#dropdown-overlay.show, 
#mobile-menu.show {
  display: block !important; /* Force it to show over Tailwind's 'hidden' */
  opacity: 1;
}

#dropdown-menu.show {
  display: block !important;
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* 7. Theme Toggle Dot Animations */
.theme-dot {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dot.active {
  transform: scale(1.25);
  opacity: 1;
  transform: translateY(0);
}

.theme-dot.inactive {
  opacity: 0.2;
  transform: translateY(1rem); /* 4 units in tailwind */
}

/* Theme Toggle Label Container */
#theme-label-container {
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Individual Theme Label height must be fixed for the math to work */
.theme-label {
  height: 1rem; /* 16px */
  line-height: 1rem;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

/* Theme Dot States */
.theme-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(12px); /* Start dropped down */
  opacity: 0.2;
}

.theme-dot.active {
  transform: translateY(0) scale(1.25);
  opacity: 1;
}

.theme-dot.inactive {
  transform: translateY(12px);
  opacity: 0.2;
}

/* 8. Mobile Menu Logic */
#mobile-menu {
  display: none; /* Default state */
  opacity: 0;
  transition: opacity 0.3s ease;
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: var(--brand-bg);
  /* FIXES START HERE */
  overflow-y: auto;          /* Enable vertical scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  padding: 3rem 1.5rem;      /* Ensure padding doesn't get cut off */
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Start from top to allow scrolling down */
}

#mobile-menu.show {
  display: flex; /* Overrides display: none */
  opacity: 1;
}

/* 9. Utility Gradient (Matching React Case) */
.blue-gradient-bg {
  background: radial-gradient(circle at 70% 30%, #0a0a0a 0%, #050505 100%);
}

/* 10. Lucide Icon Sizing Helper */
.lucide {
  width: 1.25rem; /* 5 units */
  height: 1.25rem;
}

#tsparticles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0; /* Keeps it behind your text */
  pointer-events: none; /* Allows you to still click buttons in front of it */
}

/* Ensure the hero section is relative so particles stay inside */
#hero-section {
  position: relative;
  z-index: 1;
}

/* Mobile Menu Link Styling */
.mobile-link-item {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px border-white/5;
  transition: all 0.2s ease;
}

.mobile-link-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.1);
}
