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

/* Global mobile overflow prevention */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Responsive container utilities */
.container {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

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

:root {
  /* Light Mode - Professional & Clean */
  --background: 0 0% 100%;            /* Pure white */
  --foreground: 222.2 84% 4.9%;       /* Near black */
  --card: 0 0% 100%;                  /* White cards */
  --card-foreground: 222.2 84% 4.9%;  /* Dark text on cards */
  --popover: 0 0% 100%;               /* White popover */
  --popover-foreground: 222.2 84% 4.9%; /* Dark popover text */
  
  /* Premium Primary Colors - Electric Blue */
  --primary: 214 88% 55%;             /* Rich electric blue */
  --primary-foreground: 0 0% 100%;    /* White text on primary */
  --primary-glow: 214 100% 65%;       /* Brighter blue for glow */
  --primary-variant: 200 100% 60%;    /* Cyan variant */
  
  /* AI Accent Colors - Neural Blue */
  --secondary: 220 88% 60%;           /* Neural blue */
  --secondary-foreground: 0 0% 100%;  /* White text on secondary */
  --accent: 200 100% 65%;             /* Bright cyan accent */
  --accent-foreground: 0 0% 100%;     /* White text on accent */
  
  /* Light Mode Neutrals */
  --muted: 210 40% 96%;               /* Light gray */
  --muted-foreground: 215.4 16.3% 46.9%; /* Medium gray text */
  --border: 214.3 31.8% 91.4%;       /* Light borders */
  --input: 214.3 31.8% 91.4%;        /* Input backgrounds */
  --ring: 214 88% 55%;                /* Focus ring - primary blue */
  
  /* Status Colors - Light mode variants */
  --destructive: 0 84% 60%;           /* Premium red */
  --destructive-foreground: 0 0% 100%;
  --warning: 38 92% 50%;              /* Premium amber */
  --warning-foreground: 0 0% 100%;
  --success: 142 76% 36%;             /* Premium green */
  --success-foreground: 0 0% 100%;
  
  /* AI-Powered Gradients - Light Mode */
  --gradient-primary: linear-gradient(135deg, hsl(214 88% 55%), hsl(220 88% 60%));
  --gradient-neural: linear-gradient(45deg, hsl(220 88% 60%), hsl(214 88% 55%), hsl(200 100% 60%));
  --gradient-data: linear-gradient(180deg, hsl(214 88% 55% / 0.05), hsl(220 88% 60% / 0.05));
  --gradient-card: linear-gradient(145deg, hsl(0 0% 100%), hsl(210 40% 98%));
  --gradient-premium: linear-gradient(135deg, hsl(220 88% 60% / 0.05), hsl(214 88% 55% / 0.05));
  
  /* Neural Network Pattern - Light */
  --neural-pattern: radial-gradient(circle at 25% 25%, hsl(214 88% 55% / 0.03) 0%, transparent 50%),
                    radial-gradient(circle at 75% 75%, hsl(220 88% 60% / 0.03) 0%, transparent 50%),
                    radial-gradient(circle at 50% 50%, hsl(200 100% 60% / 0.02) 0%, transparent 50%);
  
  /* Premium Shadows & Glows - Light Mode */
  --shadow-premium: 0 25px 50px -12px hsl(0 0% 0% / 0.1);
  --shadow-glow: 0 0 50px hsl(214 88% 55% / 0.2);
  --shadow-neural: 0 0 100px hsl(220 88% 60% / 0.15);
  --shadow-data: 0 10px 40px hsl(214 88% 55% / 0.1);
  
  /* Advanced Animations */
  --transition-premium: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-neural: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Grid Patterns for Tech Feel - Light */
  --grid-pattern: linear-gradient(hsl(214 88% 55% / 0.03) 1px, transparent 1px),
                  linear-gradient(90deg, hsl(214 88% 55% / 0.03) 1px, transparent 1px);
  --circuit-pattern: radial-gradient(circle at 2px 2px, hsl(214 88% 55% / 0.05) 1px, transparent 0);
}

.dark {
  /* Dark Mode - Premium & High-Tech */
  --background: 218 14% 6%;           /* Deep space black */
  --foreground: 210 40% 98%;          /* Pure white */
  --card: 218 14% 8%;                 /* Dark card background */
  --card-foreground: 210 40% 98%;     /* White text on cards */
  --popover: 218 14% 8%;              /* Dark popover */
  --popover-foreground: 210 40% 98%;  /* White popover text */
  
  /* Premium Primary Colors - Electric Blue */
  --primary: 214 88% 65%;             /* Bright electric blue */
  --primary-foreground: 218 14% 6%;   /* Dark text on primary */
  --primary-glow: 214 100% 75%;       /* Brighter blue for glow */
  --primary-variant: 200 100% 70%;    /* Cyan variant */
  
  /* AI Accent Colors - Neural Blue */
  --secondary: 220 88% 70%;           /* Neural blue */
  --secondary-foreground: 218 14% 6%; /* Dark text on secondary */
  --accent: 200 100% 75%;             /* Bright cyan accent */
  --accent-foreground: 218 14% 6%;    /* Dark text on accent */
  
  /* Dark Mode Neutrals */
  --muted: 217 10% 15%;               /* Dark muted */
  --muted-foreground: 215 15% 65%;    /* Light muted text */
  --border: 217 10% 20%;              /* Subtle borders */
  --input: 217 10% 20%;               /* Input backgrounds */
  --ring: 214 88% 65%;                /* Focus ring - primary blue */
  
  /* Status Colors - Dark mode variants */
  --destructive: 0 84% 60%;           /* Premium red */
  --destructive-foreground: 210 40% 98%;
  --warning: 38 92% 50%;              /* Premium amber */
  --warning-foreground: 218 14% 6%;
  --success: 142 76% 36%;             /* Premium green */
  --success-foreground: 210 40% 98%;
  
  /* AI-Powered Gradients - Dark Mode */
  --gradient-primary: linear-gradient(135deg, hsl(214 88% 65%), hsl(220 88% 70%));
  --gradient-neural: linear-gradient(45deg, hsl(220 88% 70%), hsl(214 88% 65%), hsl(200 100% 70%));
  --gradient-data: linear-gradient(180deg, hsl(214 88% 65% / 0.1), hsl(220 88% 70% / 0.1));
  --gradient-card: linear-gradient(145deg, hsl(218 14% 8%), hsl(217 10% 15%));
  --gradient-premium: linear-gradient(135deg, hsl(220 88% 70% / 0.1), hsl(214 88% 65% / 0.1));
  
  /* Neural Network Pattern - Dark */
  --neural-pattern: radial-gradient(circle at 25% 25%, hsl(214 88% 65% / 0.1) 0%, transparent 50%),
                    radial-gradient(circle at 75% 75%, hsl(220 88% 70% / 0.1) 0%, transparent 50%),
                    radial-gradient(circle at 50% 50%, hsl(200 100% 70% / 0.05) 0%, transparent 50%);
  
  /* Premium Shadows & Glows - Dark Mode */
  --shadow-premium: 0 25px 50px -12px hsl(218 14% 6% / 0.25);
  --shadow-glow: 0 0 50px hsl(214 88% 65% / 0.4);
  --shadow-neural: 0 0 100px hsl(220 88% 70% / 0.3);
  --shadow-data: 0 10px 40px hsl(214 88% 65% / 0.2);
  
  /* Grid Patterns for Tech Feel - Dark */
  --grid-pattern: linear-gradient(hsl(217 10% 20% / 0.1) 1px, transparent 1px),
                  linear-gradient(90deg, hsl(217 10% 20% / 0.1) 1px, transparent 1px);
  --circuit-pattern: radial-gradient(circle at 2px 2px, hsl(214 88% 65% / 0.15) 1px, transparent 0);
}

@layer base {
  * {
    @apply border-border;
  }
  
  body {
    @apply bg-background text-foreground font-sans antialiased;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-image: var(--neural-pattern);
    background-size: 100px 100px, 150px 150px, 200px 200px;
    background-attachment: fixed;
  }
  
  /* Premium Typography */
  h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
  }
  
  /* AI-Powered Section Backgrounds */
  .section-ai-powered {
    background: linear-gradient(135deg, 
      hsl(var(--background)) 0%,
      hsl(var(--muted) / 0.5) 25%,
      hsl(var(--card)) 50%,
      hsl(var(--muted) / 0.5) 75%,
      hsl(var(--background)) 100%);
    position: relative;
  }
  
  .section-ai-powered::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--neural-pattern);
    opacity: 0.3;
  }
  
  /* Neural Network Background Pattern */
  .neural-pattern {
    background-image: var(--neural-pattern);
    background-size: 100px 100px, 150px 150px, 200px 200px;
  }
  
  /* Circuit Board Pattern */
  .circuit-pattern {
    background-image: var(--circuit-pattern);
    background-size: 20px 20px;
  }
  
  /* Tech Grid Pattern */
  .grid-pattern {
    background-image: var(--grid-pattern);
    background-size: 40px 40px;
  }
}

/* Interactive Elements with Premium Feel */
@layer components {
  .hover-scale {
    @apply transition-transform duration-300 hover:scale-105;
  }
  
  .premium-card {
    @apply bg-gradient-card border border-border/50 rounded-2xl shadow-premium backdrop-blur-sm;
  }
  
  .ai-badge {
    @apply px-4 py-2 bg-gradient-premium border border-primary/30 rounded-full text-sm font-medium text-primary;
  }
  
  .neural-glow {
    @apply shadow-neural;
  }
  
  .data-stream {
    @apply relative overflow-hidden;
  }
  
  .data-stream::before {
    @apply absolute inset-0 bg-gradient-to-r from-transparent via-primary/20 to-transparent;
    content: '';
    animation: tech-scan 3s ease-in-out infinite;
  }
}

/* Mobile Optimizations */
@layer utilities {
  .mobile-optimized {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  .ios-optimized {
    -webkit-overflow-scrolling: touch;
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000px;
    transform: translate3d(0, 0, 0);
  }
  
  .touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .no-tap-highlight {
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }
}

/* AI Loading Effects */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes loading-bar {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

@keyframes scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

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

.animate-loading-bar {
  animation: loading-bar 3s ease-in-out infinite;
}

.animate-scroll {
  animation: scroll 30s linear infinite;
}

.bg-grid-pattern {
  background-image: 
    linear-gradient(rgba(var(--primary) / 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary) / 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
}