@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #070B14;
  --bg-secondary: #0D1424;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(26, 38, 66, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 240, 255, 0.4);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --color-cyan: #00F0FF;
  --color-blue: #3B82F6;
  --color-indigo: #6366F1;
  --color-emerald: #10B981;
}

html.light {
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #FFFFFF;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(14, 165, 233, 0.5);
  --text-main: #0F172A;
  --text-muted: #64748B;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-tech {
  font-family: 'Orbitron', monospace, sans-serif;
}

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

/* Lucide Icon Crisp Display & Prevent Shrink */
svg.lucide, i[data-lucide] svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #070B14;
}
::-webkit-scrollbar-thumb {
  background: #1E293B;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00F0FF;
}

/* Cyber Grid Backgrounds */
.cyber-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.cyber-grid-dense {
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
}

/* Glow Utilities */
.glow-cyan {
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
}
.glow-blue {
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.25);
}
.glow-text-cyan {
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}
.glow-text-blue {
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.glass-nav {
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html.light .glass-nav {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Header Nav Links - Single Line Fixed */
.nav-link {
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease;
  padding: 0.5rem 0.25rem;
}
.nav-link:hover {
  color: #00F0FF;
}
.nav-link.active {
  color: #00F0FF;
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #00F0FF;
  border-radius: 2px;
  box-shadow: 0 0 8px #00F0FF;
}

/* Animated Border Glow */
.border-gradient-glow {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(13, 20, 36, 0.95));
  border-radius: 1rem;
}
.border-gradient-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(90deg, #00F0FF, #3B82F6, #6366F1, #00F0FF);
  background-size: 300% 300%;
  border-radius: inherit;
  z-index: -1;
  animation: gradientRotate 6s ease infinite;
  opacity: 0.6;
}

@keyframes gradientRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Radial Lighting Orbs */
.orb-cyan {
  position: absolute;
  width: 500px;
  height: 500px;
  max-width: 100vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.12) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.orb-indigo {
  position: absolute;
  width: 600px;
  height: 600px;
  max-width: 100vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  filter: blur(70px);
  pointer-events: none;
}

/* Network Node Pulse */
@keyframes pingSlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}
.animate-ping-slow {
  animation: pingSlow 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Marquee / Infinite Slider */
@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: scrollLeft 35s linear infinite;
  will-change: transform;
}
.marquee-track:hover {
  animation-play-state: paused;
}

/* Button Shimmer */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transform: rotate(30deg);
  animation: shimmerMove 3.5s infinite;
}
@keyframes shimmerMove {
  0% { transform: translateX(-100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

/* Interactive Tabs Active State */
.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(59, 130, 246, 0.2));
  border-color: #00F0FF;
  color: #00F0FF;
}

/* Modal Transitions */
.modal-backdrop {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Styled Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: #1E293B;
  border-radius: 9999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00F0FF;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
  transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00F0FF;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}

/* Responsive Rules */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .glass-panel:hover {
    transform: none;
  }

  .safe-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

@media screen and (max-width: 380px) {
  .counter-val {
    font-size: 1.5rem !important;
  }
  h1 {
    font-size: 1.75rem !important;
  }
}

button, a, input, select {
  touch-action: manipulation;
}
