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

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

@layer base {
  :root {
    --background: 240 15% 98%;
    --foreground: 225 15% 15%;

    --card: 0 0% 100%;
    --card-foreground: 225 15% 15%;

    --popover: 0 0% 100%;
    --popover-foreground: 225 15% 15%;

    /* Medical Emergency Blue - #00478F */
    --primary: 215 100% 28%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 215 100% 24%;

    /* Emergency Red - #D62023 */
    --emergency: 357 84% 49%;
    --emergency-foreground: 0 0% 100%;
    --emergency-hover: 357 84% 44%;

    --secondary: 210 40% 96%;
    --secondary-foreground: 225 15% 15%;

    --muted: 210 40% 96%;
    --muted-foreground: 215 16% 47%;

    --accent: 210 40% 94%;
    --accent-foreground: 225 15% 15%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --border: 214 32% 91%;
    --input: 214 32% 91%;
    --ring: 210 100% 35%;

    --radius: 0.375rem;

    /* Medical specific colors */
    --medical-blue: 215 100% 28%;
    --medical-red: 357 84% 49%;
    --medical-light-blue: 210 100% 97%;
    --medical-dark-blue: 215 100% 20%;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-hover)));
    --gradient-emergency: linear-gradient(135deg, hsl(var(--emergency)), hsl(var(--emergency-hover)));
    
    /* Shadows */
    --shadow-soft: 0 2px 10px hsl(var(--primary) / 0.1);
    --shadow-medium: 0 4px 20px hsl(var(--primary) / 0.15);
    --shadow-strong: 0 8px 30px hsl(var(--primary) / 0.2);

    --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: 225 15% 8%;
    --foreground: 210 40% 98%;

    --card: 225 15% 10%;
    --card-foreground: 210 40% 98%;

    --popover: 225 15% 10%;
    --popover-foreground: 210 40% 98%;

    --primary: 210 100% 55%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 210 100% 50%;

    --emergency: 348 83% 55%;
    --emergency-foreground: 0 0% 100%;
    --emergency-hover: 348 83% 50%;

    --secondary: 217 33% 18%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217 33% 18%;
    --muted-foreground: 215 20% 65%;

    --accent: 217 33% 18%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 63% 31%;
    --destructive-foreground: 210 40% 98%;

    --border: 217 33% 18%;
    --input: 217 33% 18%;
    --ring: 213 27% 84%;
    --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%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
    font-display: swap;
  }
  
  /* Critical CSS for LCP optimization */
  .hero-image-container {
    contain: layout style paint;
    will-change: transform;
    transform: translateZ(0);
  }
  
  /* Optimize animations to avoid layout thrashing */
  .transition-all {
    transition-property: transform, opacity, background-color, border-color, color, fill, stroke;
  }
  
  /* Use transform for scale animations instead of layout properties */
  .hover\\:scale-105:hover {
    transform: scale(1.05);
  }

  /* Smooth scroll animations */
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  /* Ensure animations respect user preferences */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* Optimize scroll-triggered animations */
  .animate-on-scroll {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
  }
}

/* Remove Lovable badge completely */
[data-lovable],
[data-lovable-badge],
.lovable-badge,
[class*="lovable"],
[id*="lovable"],
a[href*="lovable.dev"],
a[href*="utm_source=lovable-badge"],
*[aria-label*="Edit with"],
*[title*="Edit with"],
*[title*="Lovable"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
