@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 {
    /* Base colors - Clean, professional medical theme */
    --background: 0 0% 100%;
    --foreground: 220 15% 20%;

    --card: 0 0% 100%;
    --card-foreground: 220 15% 20%;

    --popover: 0 0% 100%;
    --popover-foreground: 220 15% 20%;

    /* Primary - Professional Medical Blue (Trust & Authority) - #0066CC */
    --primary: 211 100% 40%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 211 100% 35%;

    /* Emergency Red - High urgency CTA - #DC1F2A */
    --emergency: 356 78% 49%;
    --emergency-foreground: 0 0% 100%;
    --emergency-hover: 356 78% 42%;

    /* Secondary - Light blue for sections */
    --secondary: 210 50% 96%;
    --secondary-foreground: 220 15% 20%;

    /* Muted - Subtle backgrounds */
    --muted: 210 40% 96%;
    --muted-foreground: 220 10% 46%;

    /* Accent - Teal for highlights & success states */
    --accent: 180 70% 42%;
    --accent-foreground: 0 0% 100%;

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

    /* Borders & inputs - Light, clean */
    --border: 214 32% 91%;
    --input: 214 32% 91%;
    --ring: 211 100% 40%;

    --radius: 0.5rem;

    /* Medical specific colors - Professional palette */
    --medical-blue: 211 100% 40%;
    --medical-red: 356 78% 49%;
    --medical-light-blue: 210 100% 97%;
    --medical-dark-blue: 211 100% 30%;
    --medical-teal: 180 70% 42%;
    --medical-green: 145 63% 42%;
    
    /* Gradients - Smooth, professional */
    --gradient-primary: linear-gradient(135deg, hsl(211 100% 40%), hsl(211 100% 30%));
    --gradient-emergency: linear-gradient(135deg, hsl(356 78% 49%), hsl(356 78% 42%));
    --gradient-hero: linear-gradient(135deg, hsl(211 100% 40%) 0%, hsl(211 100% 30%) 100%);
    --gradient-soft: linear-gradient(180deg, hsl(0 0% 100%) 0%, hsl(210 50% 98%) 100%);
    
    /* Shadows - Elevated, professional depth */
    --shadow-soft: 0 2px 8px hsla(211, 100%, 40%, 0.08);
    --shadow-medium: 0 4px 16px hsla(211, 100%, 40%, 0.12);
    --shadow-strong: 0 8px 24px hsla(211, 100%, 40%, 0.16);
    --shadow-emergency: 0 4px 20px hsla(356, 78%, 49%, 0.25);

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

    --card: 220 15% 12%;
    --card-foreground: 210 40% 98%;

    --popover: 220 15% 12%;
    --popover-foreground: 210 40% 98%;

    --primary: 211 100% 50%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 211 100% 45%;

    --emergency: 356 78% 55%;
    --emergency-foreground: 0 0% 100%;
    --emergency-hover: 356 78% 48%;

    --secondary: 220 20% 18%;
    --secondary-foreground: 210 40% 98%;

    --muted: 220 20% 18%;
    --muted-foreground: 215 20% 65%;

    --accent: 180 70% 45%;
    --accent-foreground: 0 0% 100%;

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

    --border: 220 20% 22%;
    --input: 220 20% 22%;
    --ring: 211 100% 50%;
    --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;
}
