/* SIMRS RSSA Design System - Pure CSS (No Tailwind) */

/* CSS Variables */
:root {
  /* Medical Theme Colors */
  --background: 230 20% 98%;
  --foreground: 210 20% 15%;
  --card: 0 0% 100%;
  --card-foreground: 210 20% 15%;
  --popover: 0 0% 100%;
  --popover-foreground: 210 20% 15%;

  /* Primary - Medical Green */
  --primary: 26 89% 57%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 26, 92%, 65%;

  /* Secondary - Clean Blue */
  --secondary: 210 50% 96%;
  --secondary-foreground: 210 20% 20%;
  --muted: 210 25% 95%;
  --muted-foreground: 210 15% 50%;

  /* Accent - Neutral Gray */
  --accent: 210 40% 96%;
  --accent-foreground: 222.2 84% 4.9%;
  --destructive: 0 75% 55%;
  --destructive-foreground: 0 0% 100%;
  --border: 210 20% 88%;
  --input: 210 20% 95%;
  --ring: 150 75% 35%;

  /* Medical Status Colors */
  --success: 150 75% 40%;
  --success-foreground: 0 0% 100%;
  --warning: 45 95% 60%;
  --warning-foreground: 210 20% 15%;
  --info: 210 100% 50%;
  --info-foreground: 0 0% 100%;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(150 75% 35%), hsl(150 75% 45%));
  --gradient-medical: linear-gradient(135deg, hsl(150 75% 35%), hsl(210 100% 50%));
  --gradient-subtle: linear-gradient(180deg, hsl(210 20% 98%), hsl(210 25% 95%));

  /* Shadows */
  --shadow-medical: 0 4px 20px -4px hsl(150 75% 35% / 0.15);
  --shadow-card: 0 2px 10px -2px hsl(210 20% 15% / 0.1);
  --shadow-glow: 0 0 30px hsl(150 75% 35% / 0.2);

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;

  /* Border Radius */
  --radius: 0.5rem;
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);

  /* Sidebar */
  --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: 210 25% 8%;
  --foreground: 210 20% 95%;
  --card: 210 25% 10%;
  --card-foreground: 210 20% 95%;
  --popover: 210 25% 10%;
  --popover-foreground: 210 20% 95%;
  --primary: 26 89% 57%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 26, 92%, 65%;
  --secondary: 210 25% 15%;
  --secondary-foreground: 210 20% 90%;
  --muted: 210 25% 15%;
  --muted-foreground: 210 15% 65%;
  --accent: 210 100% 55%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 75% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 210 25% 20%;
  --input: 210 25% 15%;
  --ring: 150 75% 45%;
  --success: 150 75% 50%;
  --warning: 45 95% 65%;
  --info: 210 100% 60%;
  --gradient-primary: linear-gradient(135deg, hsl(150 75% 45%), hsl(150 75% 55%));
  --gradient-medical: linear-gradient(135deg, hsl(150 75% 45%), hsl(210 100% 55%));
  --gradient-subtle: linear-gradient(180deg, hsl(210 25% 8%), hsl(210 25% 12%));
  --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%;
}

/* Keyframes for Animations */
@keyframes accordion-down {
  from {
    height: 0;
  }
  to {
    height: var(--radix-accordion-content-height);
  }
}

@keyframes accordion-up {
  from {
    height: var(--radix-accordion-content-height);
  }
  to {
    height: 0;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes pulseMedical {
  0%,
  100% {
    box-shadow: 0 0 0 0 hsl(var(--primary) / 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px hsl(var(--primary) / 0);
  }
}

/* Base Styles */
* {
  border-color: hsl(var(--border));
  box-sizing: border-box;
}

body {
  /* background-color: hsl(var(--background)); */
  /* background-color: hsl(var(--background), 0.5); */
  color: hsl(var(--foreground));
  line-height: 1.5;
  margin: 0;
}

body {
  @apply bg-slate-100 dark:bg-slate-800 ;
}

body, table, label {
  @apply md:!text-xs 2xl:!text-sm;
}

/* Container */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
}

/* Color Classes */
.bg-background {
  background-color: hsl(var(--background));
}
.bg-foreground {
  background-color: hsl(var(--foreground));
}
.bg-card {
  background-color: hsl(var(--card));
}
.bg-primary {
  background-color: hsl(var(--primary));
}
.bg-secondary {
  background-color: hsl(var(--secondary));
}
.bg-accent {
  background-color: hsl(var(--accent));
}
.bg-destructive {
  background-color: hsl(var(--destructive));
}
.bg-muted {
  background-color: hsl(var(--muted));
}
.bg-success {
  background-color: hsl(var(--success));
}
.bg-warning {
  background-color: hsl(var(--warning));
}
.bg-info {
  background-color: hsl(var(--info));
}

.text-background {
  color: hsl(var(--background));
}
.text-foreground {
  color: hsl(var(--foreground));
}
.text-card {
  color: hsl(var(--card));
}
.text-primary {
  color: hsl(var(--primary));
}
.text-secondary {
  color: hsl(var(--secondary));
}
.text-accent {
  color: hsl(var(--accent));
}
.text-destructive {
  color: hsl(var(--destructive));
}
.text-muted {
  color: hsl(var(--muted));
}
.text-success {
  color: hsl(var(--success));
}
.text-warning {
  color: hsl(var(--warning));
}
.text-info {
  color: hsl(var(--info));
}

.text-primary-foreground {
  color: hsl(var(--primary-foreground));
}
.text-secondary-foreground {
  color: hsl(var(--secondary-foreground));
}
.text-accent-foreground {
  color: hsl(var(--accent-foreground));
}
.text-destructive-foreground {
  color: hsl(var(--destructive-foreground));
}
.text-muted-foreground {
  color: hsl(var(--muted-foreground));
}
.text-success-foreground {
  color: hsl(var(--success-foreground));
}
.text-warning-foreground {
  color: hsl(var(--warning-foreground));
}
.text-info-foreground {
  color: hsl(var(--info-foreground));
}

.border-primary {
  border-color: hsl(var(--primary));
}
.border-secondary {
  border-color: hsl(var(--secondary));
}
.border-accent {
  border-color: hsl(var(--accent));
}
.border-destructive {
  border-color: hsl(var(--destructive));
}
.border-input {
  border-color: hsl(var(--input));
}

/* Sidebar Colors */
.bg-sidebar {
  background-color: hsl(var(--sidebar-background));
}
.text-sidebar {
  color: hsl(var(--sidebar-foreground));
}
.bg-sidebar-primary {
  background-color: hsl(var(--sidebar-primary));
}
.text-sidebar-primary {
  color: hsl(var(--sidebar-primary));
}
.bg-sidebar-accent {
  background-color: hsl(var(--sidebar-accent));
}
.text-sidebar-accent {
  color: hsl(var(--sidebar-accent));
}
.border-sidebar {
  border-color: hsl(var(--sidebar-border));
}

/* Background Images */
.bg-gradient-medical {
  background-image: var(--gradient-medical);
}
.bg-gradient-primary {
  background-image: var(--gradient-primary);
}
.bg-gradient-subtle {
  background-image: var(--gradient-subtle);
}

/* Border Radius */
.rounded-sm {
  border-radius: var(--radius-sm);
}

/* Form Error Styling */
.field-error-info {
  font-size: 0.75rem;
  margin-left: 0.25rem;
  color: hsl(var(--destructive));
  /* font-size: 0.875rem; */
  margin-top: 0.25rem;
  min-height: 1rem; /* Reserve space to prevent CLS */
  line-height: 1.25;
}

/* .rounded-md { border-radius: var */

/* Dashboard grid utility */
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}
