/* ==========================================================================
   SURGICAL INTERNSHIP PRACTICAL EXAM (OSCE) — MASTER STYLESHEET
   Design: Modern Clean-Clinical Medical Interface (Light Theme Permanent)
   Curated by: Dr Scalpel
   ========================================================================== */

:root {
  /* Surface & Background Hierarchy - Pure Clean Clinical Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-hover-border: #0ea5e9;
  
  /* High-Contrast Typography */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  /* Medical Diagnostic Clinical Accents (High Contrast WCAG-AA compliant) */
  --accent-cyan: #0891b2;
  --accent-blue: #0284c7;
  --accent-indigo: #4f46e5;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;
  
  /* Elevating Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.1), 0 4px 10px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
  
  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-wrap: break-word;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.28;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-cyan);
}

code, pre {
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* TOP STICKY NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  transition: var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.nav-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.35rem;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
  flex-shrink: 0;
}

/* DR SCALPEL BRANDING TAG */
.dr-scalpel-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: linear-gradient(135deg, #0284c7, #0891b2);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.dr-scalpel-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: #f0fdf4;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-xl);
  border: 1px solid #bbf7d0;
  box-shadow: var(--shadow-sm);
}

.nav-search-container {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.nav-search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background: #ffffff;
}

.nav-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-icon:hover {
  background: var(--card-hover-border);
  color: white;
}

.btn-pill {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--card-border);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-pill:hover, .btn-pill.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
}

/* QUICK SUBNAV / TICKER */
.quick-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.quick-nav-bar::-webkit-scrollbar {
  height: 4px;
}

.quick-nav-bar::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 2px;
}

/* MAIN CONTAINER */
.app-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 5rem 1.5rem;
  box-sizing: border-box;
}

/* HERO HEADER */
.hero-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 45%, #ffffff 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2.4rem 2.2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-xl);
  color: #0369a1;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.9rem;
}

.hero-title {
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 950px;
  margin-bottom: 1.6rem;
  line-height: 1.68;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.hero-stat-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* SECTION HEADERS */
.section-anchor {
  scroll-margin-top: 110px;
  margin-bottom: 2.75rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 0.75rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-badge {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-title {
  font-size: 1.65rem;
  color: var(--text-primary);
}

.section-subtitle {
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: -0.25rem;
}

/* CARDS & GLASS CONTAINERS */
.glass-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.glass-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

.card-title {
  font-size: 1.22rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
}

/* GRID LAYOUTS */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}

/* GRID & FLEX OVERFLOW SHIELD (CRITICAL FOR MOBILE) */
.grid-2, .grid-3, .grid-4, .case-grid-interactive, .hero-stats-row {
  max-width: 100%;
  min-width: 0;
}

.grid-2 > *, .grid-3 > *, .grid-4 > *, .case-grid-interactive > *, .hero-stats-row > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* CLINICAL BADGES & TAGS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-cyan { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-emerald { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-rose { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-purple { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }

/* ALERT / CALLOUT BOXES */
.callout {
  border-radius: var(--radius-md);
  padding: 1.15rem 1.3rem;
  margin: 1.25rem 0;
  display: flex;
  gap: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

.callout-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.callout-content {
  flex: 1;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.callout-tip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #10b981;
  color: #14532d;
}
.callout-tip .callout-title { color: #047857; }

.callout-warning {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}
.callout-warning .callout-title { color: #b45309; }

.callout-danger {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-left: 4px solid #f43f5e;
  color: #881337;
}
.callout-danger .callout-title { color: #be123c; }

.callout-exam {
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-left: 4px solid #6366f1;
  color: #312e81;
}
.callout-exam .callout-title { color: #4338ca; }

/* MEDICAL IMAGE CONTAINERS & GALLERIES */
.clinical-img-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.clinical-img-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
}

.clinical-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
  cursor: zoom-in;
}

.clinical-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.clinical-img-wrapper:hover img {
  transform: scale(1.03);
}

.clinical-img-caption {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--card-border);
  background: #f8fafc;
  font-size: 0.88rem;
}

.caption-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.caption-desc {
  color: #475569;
  line-height: 1.48;
}

/* TABLES STYLING */
.table-responsive {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  margin: 1rem 0;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  position: relative;
}

.med-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.med-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--card-border);
  white-space: normal;
}

.med-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.med-table tbody tr:hover {
  background: #f8fafc;
}

.med-table tbody tr:last-child td {
  border-bottom: none;
}

.val-high {
  color: #dc2626 !important;
  font-weight: 700;
}

.val-low {
  color: #2563eb !important;
  font-weight: 700;
}

.val-crit {
  background: #fee2e2;
  color: #991b1b !important;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid #fca5a5;
  display: inline-block;
}

/* INTERACTIVE CLINICAL CASES ACCORDION & CARDS */
.case-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.case-card.expanded {
  border-color: var(--accent-blue);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.12);
}

.case-header {
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.case-card.expanded .case-header {
  background: #f8fafc;
  border-bottom-color: var(--card-border);
}

.case-header:hover {
  background: #f1f5f9;
}

.case-title-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.case-num {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.case-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.case-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.case-toggle-icon {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.case-card.expanded .case-toggle-icon {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

.case-body {
  display: none;
  padding: 1.5rem;
  border-top: 1px solid var(--card-border);
  background: #ffffff;
}

.case-card.expanded .case-body {
  display: block;
}

.patient-vignette {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.35rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #1e293b;
}

.case-grid-interactive {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .case-grid-interactive {
    grid-template-columns: 1fr;
  }
}

.diag-solution-box {
  background: #f0fdf4;
  border: 1px dashed #10b981;
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-top: 1.25rem;
  display: none;
  color: #14532d;
  line-height: 1.65;
}

.diag-solution-box.revealed {
  display: block;
  animation: fadeIn 0.35s ease;
}

.diag-solution-box h4 {
  color: #047857;
  font-size: 1.1rem;
}

.diag-solution-box strong {
  color: #064e3b;
}

.diag-solution-box p {
  margin-bottom: 0.75rem;
}

.diag-solution-box p:last-child {
  margin-bottom: 0;
}

.diag-reveal-btn {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.28);
  transition: var(--transition);
}

.diag-reveal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

/* FLASHCARD DECK (RAPID REVISION) */
.flashcards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.flashcard {
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--card-border);
}

.flashcard-front {
  background: #ffffff;
  color: var(--text-primary);
}

.flashcard-front:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
}

.flashcard-back {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  transform: rotateY(180deg);
  border-color: #334155;
  text-align: left;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
  font-size: 0.88rem;
  line-height: 1.5;
}

.card-hint {
  font-size: 0.75rem;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 0.75rem;
}

/* CHECKLIST / RUBRIC */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.checklist-item:last-child {
  border-bottom: none;
}

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--accent-blue);
  background: #ffffff;
  cursor: pointer;
  margin-top: 0.2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: var(--transition);
}

.check-box.checked {
  background: var(--accent-blue);
  color: white;
}

/* MODAL IMAGE VIEWER */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.modal-caption {
  margin-top: 1rem;
  color: white;
  text-align: center;
  max-width: 800px;
  font-size: 0.95rem;
}

.modal-close-btn {
  position: absolute;
  top: -45px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2.2rem;
  cursor: pointer;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */

/* Universal Touch & Form Enhancements */
input, select, textarea, button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Back to Top Floating Button */
.back-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 1500;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.back-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top-btn:active {
  transform: scale(0.92);
}

/* Medium Devices (Tablets, landscape phones: <= 992px) */
@media (max-width: 992px) {
  .app-container {
    padding: 1.5rem 1.25rem 4.5rem 1.25rem;
  }
  .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
  }
  .case-grid-interactive {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Standard Mobile & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  /* Prevent iOS zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Responsive Navbar: 2-row clean layout */
  .navbar {
    padding: 0.65rem 0.85rem;
    flex-wrap: wrap;
    row-gap: 0.65rem;
  }

  .nav-brand {
    order: 1;
    font-size: 1.05rem;
    gap: 0.5rem;
  }

  .nav-logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    border-radius: 8px;
  }

  .nav-actions {
    order: 2;
    margin-left: auto;
  }

  .dr-scalpel-nav-pill {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
  }

  .nav-search-container {
    order: 3;
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .nav-search-input {
    padding: 0.55rem 0.85rem 0.55rem 2.3rem;
  }

  .nav-search-icon {
    left: 0.75rem;
  }

  /* Quick Navigation Bar: Touch Horizontal Carousel */
  .quick-nav-bar {
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .quick-nav-bar::-webkit-scrollbar {
    display: none;
  }

  .quick-nav-bar .btn-pill {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    min-height: 38px;
    flex-shrink: 0;
  }

  /* Container */
  .app-container {
    padding: 1.2rem 0.75rem 4rem 0.75rem;
  }

  /* Hero Header */
  .hero-banner {
    padding: 1.4rem 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
  }

  .hero-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.75rem;
    white-space: normal;
  }

  .hero-title {
    font-size: clamp(1.45rem, 5vw, 1.95rem);
    margin-bottom: 0.6rem;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
  }

  .hero-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .hero-stat-card {
    padding: 0.75rem 0.65rem;
    gap: 0.6rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    border-radius: 8px;
  }

  .stat-number {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  /* Section Headers */
  .section-anchor {
    scroll-margin-top: 130px;
    margin-bottom: 2rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .section-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
  }

  /* Grids: Single Column on Mobile */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Cards */
  .glass-card {
    padding: 1.1rem 0.9rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  .glass-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
  }

  .card-title {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  /* Tables: Horizontal Touch Scroll with Compact Cells */
  .table-responsive {
    border-radius: var(--radius-sm);
    margin: 0.75rem 0;
  }

  .med-table {
    font-size: 0.82rem;
  }

  .med-table th {
    padding: 0.6rem 0.65rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .med-table td {
    padding: 0.6rem 0.65rem;
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* Interactive Case Cards */
  .case-card {
    border-radius: var(--radius-md);
    margin-bottom: 1.15rem;
  }

  .case-header {
    padding: 0.95rem 1rem;
  }

  .case-title-area {
    gap: 0.75rem;
  }

  .case-num {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .case-name {
    font-size: 1.02rem;
    line-height: 1.3;
  }

  .case-meta {
    font-size: 0.78rem;
    margin-top: 0.15rem;
  }

  .case-body {
    padding: 1rem 0.75rem;
  }

  .patient-vignette {
    padding: 0.85rem;
    font-size: 0.88rem;
    margin-bottom: 1.1rem;
    line-height: 1.55;
  }

  .diag-reveal-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .diag-solution-box {
    padding: 1rem 0.85rem;
    font-size: 0.88rem;
  }

  /* Clinical Images */
  .clinical-img-card {
    border-radius: var(--radius-md);
  }

  .clinical-img-caption {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }

  .caption-title {
    font-size: 0.82rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* Modal Lightbox on Mobile */
  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-content {
    max-width: 96vw;
    max-height: 90vh;
  }

  .modal-img {
    max-height: 72vh;
    border-radius: 8px;
  }

  .modal-close-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    line-height: 1;
    z-index: 2005;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .modal-caption {
    font-size: 0.82rem;
    margin-top: 0.65rem;
    padding: 0 0.5rem;
  }

  /* Flashcards */
  .flashcards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .flashcard {
    height: 205px;
  }

  .flashcard-front, .flashcard-back {
    padding: 1rem;
    font-size: 0.88rem;
  }

  /* OSCE Live Scorer Checklist */
  .checklist-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.85rem 0.25rem;
  }

  .osce-station-score {
    width: 100%;
    min-height: 44px;
    font-size: 0.92rem;
    padding: 0.55rem;
  }

  /* Back to Top button on mobile */
  .back-to-top-btn {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
}

/* Small Smartphone Optimization (<= 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 1rem 0.55rem 3.5rem 0.55rem;
  }

  .nav-brand {
    font-size: 0.95rem;
  }

  .dr-scalpel-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  .hero-banner {
    padding: 1.2rem 0.85rem;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .stat-number {
    font-size: 1rem;
  }

  .glass-card {
    padding: 0.95rem 0.75rem;
  }

  .case-header {
    padding: 0.85rem 0.75rem;
  }

  .case-body {
    padding: 0.85rem 0.65rem;
  }

  .patient-vignette {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
}

/* Extra Small Devices (<= 360px) */
@media (max-width: 360px) {
  .hero-stats-row {
    grid-template-columns: 1fr;
  }
  .nav-brand span:first-child {
    font-size: 0.85rem;
  }
  .dr-scalpel-nav-pill {
    display: none;
  }
}

/* PRINT STYLES */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .navbar, .quick-nav-bar, .diag-reveal-btn, .modal-overlay, .nav-search-container {
    display: none !important;
  }
  .app-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .glass-card, .case-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }
  .case-body {
    display: block !important;
  }
  .diag-solution-box {
    display: block !important;
  }
}
