@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Medical Calm Theme - Light (Teal/Slate) */
    --background: 210 40% 98%; /* Slate-50 */
    --foreground: 222 47% 11%; /* Slate-900 */

    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;

    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;

    /* Primary: Teal-600 */
    --primary: 175 84% 32%; 
    --primary-foreground: 0 0% 100%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222 47% 11%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215 16% 47%;

    --accent: 175 84% 95%; /* Teal-50 for subtle accents */
    --accent-foreground: 175 84% 32%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214 32% 91%;
    --input: 214 32% 91%;
    --ring: 175 84% 32%; /* Match primary */

    --radius: 0.75rem;

    /* Semantic Draft Colors (Amber) */
    --draft: 48 100% 96%; /* Amber-50 */
    --draft-foreground: 38 92% 50%; /* Amber-600 */

    /* Data Viz */
    --chart-1: 175 84% 32%; /* Teal */
    --chart-2: 210 40% 60%; /* Slate */
    --chart-3: 48 96% 53%; /* Amber */
    --chart-4: 199 89% 48%;
    --chart-5: 27 87% 67%;
  }

  .dark {
    /* Medical Slate Theme - Dark */
    --background: 222 47% 11%;
    --foreground: 210 40% 98%;

    --card: 217 33% 17%;
    --card-foreground: 210 40% 98%;

    --popover: 222 47% 11%;
    --popover-foreground: 210 40% 98%;

    --primary: 217 91% 60%;
    --primary-foreground: 222 47% 11%;

    --secondary: 217 33% 17%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217 33% 17%;
    --muted-foreground: 215 20% 65%;

    --accent: 217 33% 17%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217 33% 17%;
    --input: 217 33% 17%;
    --ring: 224 76% 48%;

    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground antialiased;
    font-feature-settings: "rlig" 1, "calt" 1;
  }
}

/* User Requested Fixes & Utilities */
@layer utilities {
  .glass {
    background: hsl(var(--background) / 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .ai-input {
    background-color: hsl(var(--secondary));
    border-color: hsl(var(--primary) / 0.3);
    backdrop-filter: blur(4px);
  }

  .animate-pulse-red {
    animation: pulse-red 2s infinite;
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.5);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    border-color: rgba(239, 68, 68, 0.2);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    border-color: rgba(239, 68, 68, 0);
  }
}