@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 2%;
    --foreground: 0 0% 100%;
    --card: 0 0% 7%;
    --card-foreground: 0 0% 100%;
    --popover: 0 0% 7%;
    --popover-foreground: 0 0% 100%;
    --primary: 72 100% 50%;
    --primary-foreground: 0 0% 0%;
    --secondary: 180 100% 50%;
    --secondary-foreground: 0 0% 0%;
    --muted: 0 0% 15%;
    --muted-foreground: 0 0% 53%;
    --accent: 72 100% 50%;
    --accent-foreground: 0 0% 0%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 20%;
    --input: 0 0% 20%;
    --ring: 72 100% 50%;
    --radius: 0.75rem;
    
    /* Custom Colors */
    --neon-lime: #CCFF00;
    --electric-cyan: #00FFFF;
    --deep-void: #050505;
    --surface: #111111;
    --text-muted: #9CA3AF;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  
  html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  body {
    @apply bg-[#050505] text-white;
    font-family: 'Rajdhani', system-ui, sans-serif;
    overflow-x: hidden;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', system-ui, sans-serif;
    letter-spacing: 0.05em;
  }
  
  ::selection {
    background: var(--neon-lime);
    color: #000;
  }
}

@layer components {
  /* Neon Glow Effects */
  .neon-glow {
    box-shadow: 0 0 10px var(--neon-lime),
                0 0 20px var(--neon-lime),
                0 0 40px var(--neon-lime);
  }
  
  .neon-text-glow {
    text-shadow: 0 0 10px var(--neon-lime),
                 0 0 20px var(--neon-lime),
                 0 0 40px var(--neon-lime);
  }
  
  .cyan-glow {
    box-shadow: 0 0 10px var(--electric-cyan),
                0 0 20px var(--electric-cyan);
  }
  
  /* Glassmorphism Card */
  .glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
  }
  
  .glass-card:hover {
    border-color: var(--neon-lime);
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.2);
  }
  
  /* Outline Text */
  .text-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--neon-lime);
    text-stroke: 2px var(--neon-lime);
  }
  
  /* Gradient Text */
  .gradient-text {
    background: linear-gradient(135deg, var(--neon-lime), var(--electric-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* Button Styles */
  .btn-neon {
    @apply px-8 py-4 rounded-full font-semibold text-black transition-all duration-300;
    background: var(--neon-lime);
    font-family: 'Orbitron', sans-serif;
  }
  
  .btn-neon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--neon-lime);
  }
  
  /* Section Styles */
  .section-padding {
    @apply px-4 sm:px-6 lg:px-8 xl:px-16 2xl:px-24;
  }
  
  /* Custom Scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--deep-void);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--neon-lime);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--electric-cyan);
  }
  
  /* Loading Animation */
  @keyframes pulse-glow {
    0%, 100% {
      box-shadow: 0 0 10px var(--neon-lime);
    }
    50% {
      box-shadow: 0 0 30px var(--neon-lime), 0 0 60px var(--neon-lime);
    }
  }
  
  .animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
  }
  
  /* Glitch Effect */
  @keyframes glitch {
    0% {
      clip-path: inset(40% 0 61% 0);
      transform: translate(-2px, 2px);
    }
    20% {
      clip-path: inset(92% 0 1% 0);
      transform: translate(2px, -2px);
    }
    40% {
      clip-path: inset(43% 0 1% 0);
      transform: translate(-2px, 2px);
    }
    60% {
      clip-path: inset(25% 0 58% 0);
      transform: translate(2px, -2px);
    }
    80% {
      clip-path: inset(54% 0 7% 0);
      transform: translate(-2px, 2px);
    }
    100% {
      clip-path: inset(58% 0 43% 0);
      transform: translate(2px, -2px);
    }
  }
  
  .glitch-text {
    position: relative;
  }
  
  .glitch-text::before,
  .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
  }
  
  .glitch-text::before {
    color: var(--electric-cyan);
    animation: glitch 2s infinite linear alternate-reverse;
  }
  
  .glitch-text::after {
    color: var(--neon-lime);
    animation: glitch 3s infinite linear alternate-reverse;
  }
  
  /* Starfield Canvas */
  .starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }
  
  /* Magnetic Button Effect */
  .magnetic-btn {
    transition: transform 0.15s ease-out;
  }
  
  /* Card 3D Tilt */
  .card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.3s ease;
  }
  
  .card-3d:hover {
    transform: rotateX(5deg) rotateY(5deg);
  }
  
  /* Underline Animation */
  .animated-underline {
    position: relative;
  }
  
  .animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-lime);
    transition: width 0.3s ease;
  }
  
  .animated-underline:hover::after {
    width: 100%;
  }
  
  /* Fade In Animation */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
  }
  
  /* Stagger Animation Delays */
  .stagger-1 { animation-delay: 0.1s; }
  .stagger-2 { animation-delay: 0.2s; }
  .stagger-3 { animation-delay: 0.3s; }
  .stagger-4 { animation-delay: 0.4s; }
  .stagger-5 { animation-delay: 0.5s; }
}

/* Lenis Smooth Scroll */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
  .text-outline {
    -webkit-text-stroke: 1px var(--neon-lime);
    text-stroke: 1px var(--neon-lime);
  }
  
  .neon-glow {
    box-shadow: 0 0 5px var(--neon-lime),
                0 0 10px var(--neon-lime);
  }
}
