/* ==========================================================================
   HIMKIV Health & MedGuide - UI/UX Pro Max Clinical Design System
   Accessible & Ethical Medical Typography, Elevation, Focus & Dark Tokens
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&family=Noto+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Clinical Trust Brand Tokens */
  --font-heading: 'Figtree', system-ui, -apple-system, sans-serif;
  --font-body: 'Noto Sans', system-ui, -apple-system, sans-serif;

  --color-primary-50: #f0f9ff;
  --color-primary-100: #e0f2fe;
  --color-primary-500: #0284c7;
  --color-primary-600: #0369a1;
  --color-primary-700: #075985;
  --color-primary-900: #0c4a6e;

  --color-emerald-50: #ecfdf5;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  --color-emerald-700: #047857;

  --color-danger-50: #fef2f2;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;

  --color-warning-50: #fffbeb;
  --color-warning-600: #d97706;

  /* Surfaces & Text */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px -3px rgba(2, 132, 199, 0.15);
}

.dark {
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --border-subtle: #1e293b;
  --border-medium: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px -3px rgba(14, 165, 233, 0.25);
}

/* Base resets & typography */
html {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-app);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

/* Accessibility: WCAG 2.2 AAA visible focus state */
:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Touch targets >= 44px minimum touch height */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Interactive Card Elevate & Press effect */
.interactive-card {
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms ease;
}
.interactive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.interactive-card:active {
  transform: scale(0.99);
}

/* Subtle Gradient Glow accents */
.hero-glow {
  background: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.12) 0%, rgba(5, 150, 105, 0.05) 50%, transparent 80%);
}

.dark .hero-glow {
  background: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.2) 0%, rgba(5, 150, 105, 0.1) 50%, transparent 80%);
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: #cbd5e1;
  height: 8px;
  border-radius: 4px;
  outline: none;
}
.dark input[type="range"] {
  background: #334155;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0284c7;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 120ms ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Smooth Drawer & Modal backdrop */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Custom Scrollbar for Medicine List and Survey */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Clean Clinical Print Stylesheet */
@media print {
  nav, footer, .no-print, #medicine-search-section, #dosage-sandbox-section, #safety-guide-section {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .print-only-show {
    display: block !important;
  }
  .shadow-md, .shadow-lg, .shadow-sm {
    box-shadow: none !important;
    border: 1px solid #000000 !important;
  }
}
