@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap');

/* --- DESIGN SYSTEM TOKENS --- */
:root {
  /* Colors */
  --bg-primary: #FAF9F6;       /* Soft Warm White */
  --bg-secondary: #F3F4F1;     /* Mist Gray */
  --surface: #FFFFFF;          /* Cloud White */
  --text-primary: #1E293B;     /* Deep Slate */
  --text-secondary: #64748B;   /* Warm Gray */
  --accent-blue: #0284C7;      /* Calm Blue */
  --accent-blue-light: #E0F2FE;
  --accent-sage: #4F772D;      /* Soft Sage Green */
  --accent-sage-light: #EAF2E8;
  
  --success: #16A34A;          /* Natural Green */
  --warning: #D97706;          /* Muted Amber */
  --error: #E11D48;            /* Soft Coral */
  
  /* Borders */
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  /* Spacing (8px grid) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;
  
  /* Borders & Radius */
  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-dialog: 20px;
  --radius-input: 12px;
  
  /* Transitions */
  --transition-micro: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-std: 350ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Shadows */
  --shadow-ambient: 0 4px 30px rgba(0, 0, 0, 0.02);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.04);
  --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.02);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* --- ACCESSIBILITY / REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-micro: 0ms;
    --transition-std: 0ms;
    --transition-slow: 0ms;
  }
  * {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* --- RESET & BASIC STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* --- GRID SYSTEM --- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

@media (max-width: 1024px) {
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
}

/* --- LOADING EXPERIENCE --- */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-slow);
}

.heartbeat-container {
  width: 300px;
  height: 120px;
  position: relative;
}

.heartbeat-svg {
  width: 100%;
  height: 100%;
}

.pulse-line {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawPulse 2.5s ease-in-out infinite;
}

.loading-logo {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin-top: var(--space-md);
  color: var(--text-primary);
  opacity: 0;
  animation: fadeInLogo 2.5s ease-in-out forwards;
}

@keyframes drawPulse {
  0% {
    stroke-dashoffset: 1000;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -1000;
  }
}

@keyframes fadeInLogo {
  30% { opacity: 0; transform: translateY(5px); }
  60% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; }
}

/* --- HEADER / NAVIGATION --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background-color var(--transition-std), backdrop-filter var(--transition-std), box-shadow var(--transition-std);
  border-bottom: 1px solid transparent;
}

header.scrolled {
  background-color: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  box-shadow: var(--shadow-header);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.logo-icon {
  width: 12px;
  height: 12px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  position: relative;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 1px solid var(--accent-blue);
  border-radius: 50%;
  animation: logoPulse 2s infinite ease-out;
}

@keyframes logoPulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

nav {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
}

nav a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-micro);
  position: relative;
  padding: 6px 0;
}

nav a:hover, nav a.active {
  color: var(--text-primary);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-blue);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* --- BUTTONS --- */
.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--transition-std);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #FFFFFF;
  border: 1px solid var(--accent-blue);
}

.btn-primary:hover {
  background-color: #0274ae;
  border-color: #0274ae;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

.btn-emergency {
  background-color: var(--error);
  color: #FFFFFF;
  border: 1px solid var(--error);
  font-weight: 600;
}

.btn-emergency:hover {
  background-color: #be123c;
  border-color: #be123c;
  transform: scale(1.02);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-text:hover {
  background-color: var(--accent-blue-light);
}

/* --- VIEWS CONTROLLER --- */
.view-container {
  display: none;
  padding-top: 100px;
  min-height: calc(100vh - 80px);
  animation: viewFadeIn var(--transition-slow) forwards;
}

.view-container.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- HERO SECTION --- */
.hero {
  padding: var(--space-xxl) 0 var(--space-4xl) 0;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-xl);
  align-items: center;
}

@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

.hero-content {
  max-width: 580px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background-color: var(--accent-sage-light);
  color: var(--accent-sage);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-sage);
  border-radius: 50%;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 54px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.5px;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 38px;
  }
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.hero-actions-row {
  display: flex;
  gap: var(--space-sm);
}

@media (max-width: 480px) {
  .hero-actions-row {
    flex-direction: column;
  }
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  height: 480px;
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-image-overlay {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  right: var(--space-md);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: var(--space-sm);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.hero-image-overlay p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* --- QUICK SEARCH COMPONENT --- */
.quick-search-box {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
  margin-top: -40px;
  position: relative;
  z-index: 10;
  border: 1px solid var(--border-color);
}

.quick-search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: var(--space-sm);
  align-items: flex-end;
}

@media (max-width: 768px) {
  .quick-search-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.search-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-field select, .search-field input {
  padding: 12px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-color);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  outline: none;
  transition: all var(--transition-micro);
}

.search-field select:focus, .search-field input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-light);
  background-color: var(--surface);
}

/* --- EDITORIAL INTRODUCTION --- */
.intro-section {
  padding: var(--space-4xl) 0;
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-xl);
  align-items: center;
}

@media (max-width: 968px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }
}

.intro-serif-heading {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.3;
  color: var(--text-primary);
  font-weight: 400;
}

.intro-text-block {
  max-width: 600px;
}

.intro-text-block p {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

/* --- CARE PHILOSOPHY --- */
.philosophy-section {
  padding: var(--space-4xl) 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl) auto;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.section-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 968px) {
  .philosophy-grid {
    grid-template-columns: 1fr;
  }
}

.philosophy-card {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-ambient);
  transition: transform var(--transition-std), box-shadow var(--transition-std);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.philosophy-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.philosophy-icon-box {
  width: 48px;
  height: 48px;
  background-color: var(--accent-sage-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-sage);
}

.philosophy-card h3 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.philosophy-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* --- MEDICAL SPECIALTIES --- */
.specialties-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

@media (max-width: 1024px) {
  .specialties-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .specialties-grid {
    grid-template-columns: 1fr;
  }
}

.specialty-card {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-std);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
}

.specialty-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-soft);
}

.specialty-card-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.specialty-icon {
  width: 40px;
  height: 40px;
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.specialty-card h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.specialty-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

.specialty-link {
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
}

/* --- DOCTOR SEARCH / DIRECTORY --- */
.directory-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@media (max-width: 768px) {
  .directory-layout {
    grid-template-columns: 1fr;
  }
}

.filters-panel {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  align-self: start;
}

.filter-group {
  margin-bottom: var(--space-md);
}

.filter-group h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-checkboxes label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

.filter-checkboxes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: var(--accent-blue);
}

.doctor-results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 1024px) {
  .doctor-results {
    grid-template-columns: 1fr;
  }
}

.doctor-card {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-ambient);
  display: flex;
  transition: all var(--transition-std);
}

.doctor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: var(--accent-blue);
}

@media (max-width: 480px) {
  .doctor-card {
    flex-direction: column;
  }
}

.doctor-portrait {
  width: 160px;
  height: 220px;
  object-fit: cover;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .doctor-portrait {
    width: 100%;
    height: 180px;
  }
}

.doctor-info {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.doctor-meta h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.doctor-specialty {
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.doctor-details-brief {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doctor-availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  background-color: var(--accent-sage-light);
  color: var(--accent-sage);
  padding: 4px 8px;
  border-radius: 12px;
  align-self: flex-start;
  margin-bottom: var(--space-sm);
}

.doctor-actions {
  display: flex;
  gap: var(--space-xs);
}

/* --- DOCTOR DETAIL MODAL --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-std);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background-color: var(--bg-primary);
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  border-radius: var(--radius-dialog);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition-std);
  border: 1px solid var(--border-color);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color var(--transition-micro);
}

.modal-close-btn:hover {
  background-color: var(--bg-secondary);
}

.doctor-modal-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-md);
  padding: var(--space-lg);
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 580px) {
  .doctor-modal-header {
    grid-template-columns: 1fr;
  }
}

.doctor-modal-portrait {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-card);
}

.doctor-modal-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.doctor-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.doctor-philosophy-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text-primary);
  line-height: 1.5;
  border-left: 3px solid var(--accent-sage);
  padding-left: var(--space-sm);
  margin: var(--space-xs) 0;
}

/* --- PATIENT PORTAL --- */
.portal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

@media (max-width: 768px) {
  .portal-layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.portal-nav-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-micro);
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-nav-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.portal-nav-btn.active {
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  font-weight: 600;
}

.portal-content-box {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  padding: var(--space-lg);
  min-height: 500px;
}

.portal-tab-view {
  display: none;
}

.portal-tab-view.active {
  display: block;
}

/* Lab reports visualizer */
.lab-reports-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.lab-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-std);
}

.lab-card:hover {
  border-color: var(--accent-blue);
  background-color: var(--bg-primary);
}

.lab-status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.lab-status-badge.normal {
  background-color: var(--accent-sage-light);
  color: var(--accent-sage);
}

.lab-status-badge.abnormal {
  background-color: #FFEBEB;
  color: var(--error);
}

/* Lab details component */
.lab-details-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.lab-test-item {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-md);
}

.lab-test-header {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  margin-bottom: 6px;
}

.lab-range-visualizer {
  height: 24px;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin: var(--space-xs) 0;
}

.lab-normal-zone {
  position: absolute;
  height: 100%;
  background-color: var(--accent-sage-light);
  border-left: 2px solid rgba(22, 163, 74, 0.2);
  border-right: 2px solid rgba(22, 163, 74, 0.2);
}

.lab-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--accent-blue);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  top: 6px;
  transform: translateX(-6px);
  transition: left var(--transition-slow);
}

.lab-test-ranges {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Prescriptions timeline */
.prescriptions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 968px) {
  .prescriptions-grid {
    grid-template-columns: 1fr;
  }
}

.prescription-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.prescription-med {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.med-icon {
  width: 36px;
  height: 36px;
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- BOOKING WIZARD --- */
.booking-wizard {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.wizard-progress {
  display: flex;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.wizard-step-tab {
  flex: 1;
  text-align: center;
  padding: var(--space-sm) var(--space-xs);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-color);
  position: relative;
  transition: all var(--transition-micro);
}

.wizard-step-tab:last-child {
  border-right: none;
}

.wizard-step-tab.active {
  background-color: var(--surface);
  color: var(--accent-blue);
  font-weight: 600;
}

.wizard-step-tab.completed {
  color: var(--accent-sage);
}

.wizard-body {
  padding: var(--space-xl);
  min-height: 380px;
}

@media (max-width: 580px) {
  .wizard-body {
    padding: var(--space-md);
  }
}

.wizard-step-view {
  display: none;
}

.wizard-step-view.active {
  display: block;
}

.wizard-step-view h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

@media (max-width: 580px) {
  .selection-grid {
    grid-template-columns: 1fr;
  }
}

.selection-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-micro);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.selection-card:hover {
  background-color: var(--bg-secondary);
  border-color: var(--accent-blue);
}

.selection-card.active {
  border-color: var(--accent-blue);
  background-color: var(--accent-blue-light);
}

.wizard-footer {
  padding: var(--space-md) var(--space-xl);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

/* --- CAMPUS EXPLORER --- */
.explorer-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

@media (max-width: 1024px) {
  .explorer-layout {
    grid-template-columns: 1fr;
  }
}

.map-container {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  box-shadow: var(--shadow-ambient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.map-svg-wrapper {
  width: 100%;
  max-width: 600px;
  position: relative;
}

.map-area {
  cursor: pointer;
  transition: fill var(--transition-std);
}

.map-area:hover, .map-area.active {
  fill: rgba(2, 132, 199, 0.15) !important;
  stroke: var(--accent-blue) !important;
  stroke-width: 2 !important;
}

.explorer-info-card {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
  align-self: start;
}

.explorer-room-title {
  font-family: var(--font-serif);
  font-size: 24px;
  margin-bottom: var(--space-xs);
}

.explorer-room-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-card);
  margin-top: var(--space-sm);
  border: 1px solid var(--border-color);
}

/* --- HEALTH LIBRARY --- */
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

@media (max-width: 968px) {
  .library-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .library-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  padding: var(--space-md);
  box-shadow: var(--shadow-ambient);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-std);
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: var(--accent-blue);
}

.article-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-sage);
  background-color: var(--accent-sage-light);
  padding: 4px 8px;
  border-radius: 12px;
  align-self: flex-start;
  margin-bottom: var(--space-sm);
}

.article-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.article-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-xs);
}

/* --- PATIENT STORIES --- */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.story-card-large {
  background-color: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  padding: var(--space-lg);
  box-shadow: var(--shadow-ambient);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .story-card-large {
    grid-template-columns: 1fr;
  }
}

.story-portrait {
  width: 100%;
  height: 100%;
  min-height: 240px;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-card);
}

.story-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-quote {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.story-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
  border-left: 2px solid var(--accent-sage-light);
  padding-left: var(--space-md);
  position: relative;
}

.timeline-milestone {
  position: relative;
}

.timeline-milestone::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-md) - 5px);
  top: 6px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-sage);
  border-radius: 50%;
}

.milestone-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-sage);
}

.milestone-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- EMERGENCY OVERLAY --- */
#emergency-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5000;
  background-color: rgba(225, 29, 72, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-std);
}

#emergency-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.emergency-content {
  max-width: 600px;
  text-align: center;
  color: #FFFFFF;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.emergency-content h2 {
  font-family: var(--font-serif);
  font-size: 42px;
}

.emergency-number {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: var(--space-sm) 0;
}

.emergency-actions-row {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

/* --- AUDIO WIDGET --- */
.audio-control {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
}

.audio-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* --- FOOTER --- */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-4xl) 0 var(--space-xl) 0;
  margin-top: var(--space-4xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: var(--space-xs);
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 280px;
}

.footer-links-col h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-links-col a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-micro);
}

.footer-links-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-sm);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================================
   MOBILE OPTIMIZATION — TOUCH TARGETS
   ============================================================ */
@media (pointer: coarse) {
  .btn, .nav-link, .tab-btn, .feature-tab, .metric-card,
  .header-actions button, a, button {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn { padding: 14px 22px; }
  body { cursor: auto; -webkit-text-size-adjust: 100%; }
  html, body { overflow-x: hidden; overscroll-behavior-x: none; }
}

