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

/* Import focused CSS modules */
@import './styles/utilities.css';
@import './styles/animations.css';
@import './styles/mobile.css';

/* Definition of the design system. All colors, gradients, fonts, etc should be defined here. */

/* Performance variables for dynamic optimization */
:root {
  --animation-duration: 0.6s;
  --transition-duration: 0.3s;
  --float-distance: -20px;
  --gpu-optimization: translate3d(0, 0, 0);
  
  /* Enhanced text colors for better vibrancy */
  --text-vibrant-white: #FEFEFE;
  --text-warm-white: #F8F9FA;
  --text-bright-white: #FFFFFF;
  
  /* Text shadow for depth and contrast */
  --text-shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.1);
  --text-shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.2);
  --text-shadow-strong: 0 2px 4px rgba(0, 0, 0, 0.3);
  --text-shadow-glow: 0 0 8px rgba(255, 255, 255, 0.1);
}

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;

    --radius: 0.5rem;

    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

/* Performance optimizations */
.gpu-optimized {
  transform: var(--gpu-optimization);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

/* Mobile-specific performance improvements */
@media (max-width: 768px) {
  :root {
    --animation-duration: 0.3s;
    --transition-duration: 0.2s;
    --float-distance: -5px;
  }
  
  /* Touch-optimized elements */
  button, a, [role="button"] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }
  
  /* Smooth scrolling for mobile */
  * {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Reduced animations on low-end devices */
  @media (max-device-width: 480px) and (max-device-height: 854px) {
    .animate-float {
      animation-duration: 4s;
      transform: var(--gpu-optimization);
    }
    
    .animate-pulse {
      animation-duration: 1.5s;
    }
  }
}

/* High-performance mode for capable devices */
@media (min-width: 1024px) and (min-resolution: 120dpi) {
  .animate-float {
    animation-duration: 20s;
    transform: translate3d(0, 0, 0);
  }
  
  .animate-pulse-glow {
    animation-duration: 3s;
  }
}

/* Enhanced typography utilities */
.text-vibrant {
  color: var(--text-vibrant-white);
  text-shadow: var(--text-shadow-subtle);
}

.text-warm {
  color: var(--text-warm-white);
  text-shadow: var(--text-shadow-soft);
}

.text-bright {
  color: var(--text-bright-white);
  text-shadow: var(--text-shadow-strong);
}

.text-glow {
  color: var(--text-bright-white);
  text-shadow: var(--text-shadow-glow);
}

.heading-enhanced {
  color: var(--text-vibrant-white);
  text-shadow: var(--text-shadow-soft);
}

.text-crisp-slate {
  color: hsl(210, 40%, 25%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.text-crisp-gray {
  color: hsl(210, 20%, 35%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.text-crisp-charcoal {
  color: hsl(210, 30%, 20%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.button-text-enhanced {
  color: var(--text-bright-white) !important;
  text-shadow: var(--text-shadow-strong);
  font-weight: 600;
}

/* Modal overflow control to prevent forced reflows */
.modal-open {
  overflow: hidden !important;
}

/* Performance optimized classes */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.no-reflow {
  contain: layout style paint;
}

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --animation-duration: 0s;
    --transition-duration: 0s;
  }
  
  .animate-spin,
  .animate-pulse,
  .animate-float,
  .animate-bounce,
  .animate-fadeInUp {
    animation: none !important;
    transition: none !important;
  }
}
