/* ============================================================
   RADIOGRAPHY 101 — Global Design System
   Dark Medical/Tech Theme
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary:    #080c18;
  --bg-secondary:  #0d1225;
  --bg-card:       #121a30;
  --bg-card-hover: #182040;
  --accent-teal:   #00d4ff;
  --accent-cyan:   #00b4d8;
  --accent-green:  #00e5a0;
  --accent-purple: #7c4dff;
  --accent-orange: #ff6b35;
  --accent-gold:   #ffd700;
  --accent-red:    #ff4757;
  --text-primary:  #e8edf6;
  --text-secondary:#8892b0;
  --text-muted:    #4a5568;
  --border:        rgba(0, 212, 255, 0.15);
  --border-hover:  rgba(0, 212, 255, 0.4);
  --glow-teal:     0 0 20px rgba(0, 212, 255, 0.25);
  --glow-strong:   0 0 40px rgba(0, 212, 255, 0.4);
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main:     'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
}

/* Modality accent colors */
.mod-xray       { --mod-color: #00d4ff; --mod-glow: rgba(0,212,255,0.3); }
.mod-ultrasound { --mod-color: #00e5a0; --mod-glow: rgba(0,229,160,0.3); }
.mod-mri        { --mod-color: #7c4dff; --mod-glow: rgba(124,77,255,0.3); }
.mod-ct         { --mod-color: #ff6b35; --mod-glow: rgba(255,107,53,0.3); }
.mod-nuclear    { --mod-color: #ffd700; --mod-glow: rgba(255,215,0,0.3); }
.mod-radiotherapy { --mod-color: #ff4757; --mod-glow: rgba(255,71,87,0.3); }
.mod-history    { --mod-color: #a0c4ff; --mod-glow: rgba(160,196,255,0.3); }

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-teal); text-decoration: none; transition: var(--transition); }
a:hover { color: #fff; }

img { max-width: 100%; display: block; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(8, 12, 24, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: var(--glow-teal);
}

.nav-logo span { color: var(--accent-teal); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.1);
}

.nav-links a.active {
  color: var(--accent-teal);
  border: 1px solid var(--border);
}

.nav-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mod-color, var(--accent-teal));
  display: inline-block;
  box-shadow: 0 0 8px var(--mod-color, var(--accent-teal));
}

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page-wrapper {
  padding-top: 64px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 2rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,212,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(124,77,255,0.08) 0%, transparent 50%),
    var(--bg-primary);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-teal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-badge::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent-teal);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-teal);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

/* Page hero (inner pages) */
.page-hero {
  position: relative;
  padding: 5rem 2rem 3rem;
  overflow: hidden;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 10% 50%, var(--mod-glow, rgba(0,212,255,0.1)) 0%, transparent 60%);
}

.page-hero .container { position: relative; z-index: 2; }

.page-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mod-color, var(--accent-teal));
  margin-bottom: 1rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.page-hero h1 span {
  color: var(--mod-color, var(--accent-teal));
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.8;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: var(--bg-primary);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.45);
  color: var(--bg-primary);
}

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

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.modality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.modality-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.modality-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mod-color), transparent);
}

.modality-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 0% 0%, var(--mod-glow) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.modality-card:hover {
  border-color: var(--mod-color);
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--mod-glow);
  color: inherit;
}

.modality-card:hover::after { opacity: 1; }

.mod-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 20px var(--mod-glow);
}

.modality-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.modality-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.mod-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 1rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--mod-color);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mod-color);
  position: relative;
  z-index: 1;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mod-color, var(--accent-teal));
  margin-bottom: 0.75rem;
}

.section-label::before {
  content: '';
  width: 16px; height: 2px;
  background: var(--mod-color, var(--accent-teal));
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.75;
  margin-bottom: 3rem;
}

/* ============================================================
   TOPIC SECTIONS (inner pages)
   ============================================================ */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

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

.topic-text h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.topic-text h2 span { color: var(--mod-color, var(--accent-teal)); }

.topic-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.key-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.key-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.key-points li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mod-color, var(--accent-teal));
  box-shadow: 0 0 8px var(--mod-color, var(--accent-teal));
  flex-shrink: 0;
  margin-top: 7px;
}

/* ============================================================
   INTERACTIVE DIAGRAM CONTAINER
   ============================================================ */
.diagram-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.diagram-box svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diagram-title::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--mod-color, var(--accent-teal));
  box-shadow: 0 0 10px var(--mod-color, var(--accent-teal));
}

/* Tooltip for diagrams */
.svg-tooltip {
  position: absolute;
  background: var(--bg-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
  max-width: 200px;
  line-height: 1.5;
  box-shadow: var(--glow-teal);
}

.svg-tooltip.visible { opacity: 1; }

/* ============================================================
   STAT / FACT CARDS
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mod-color, var(--accent-teal));
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

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

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-main);
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--mod-color, var(--accent-teal));
  border-bottom-color: var(--mod-color, var(--accent-teal));
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   INFO CALLOUTS
   ============================================================ */
.callout {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-teal);
  background: rgba(0, 212, 255, 0.05);
  margin: 1.5rem 0;
}

.callout-icon { font-size: 1.25rem; flex-shrink: 0; }

.callout p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.callout.warning {
  border-left-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.05);
}

.callout.danger {
  border-left-color: var(--accent-red);
  background: rgba(255, 71, 87, 0.05);
}

.callout.success {
  border-left-color: var(--accent-green);
  background: rgba(0, 229, 160, 0.05);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover { color: var(--accent-teal); }

.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: 6rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.footer-logo span { color: var(--accent-teal); }

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links a:hover { color: var(--accent-teal); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--mod-glow, rgba(0,212,255,0.2)); }
  50%       { box-shadow: 0 0 40px var(--mod-glow, rgba(0,212,255,0.4)); }
}

@keyframes scan-line {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes beam-travel {
  0%   { stroke-dashoffset: 200; opacity: 0.3; }
  50%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

@keyframes wave-pulse {
  0%,100% { r: 0; opacity: 1; }
  100%    { r: 40; opacity: 0; }
}

.animate-in {
  animation: fade-in-up 0.6s ease forwards;
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================================
   SCROLL OBSERVER — fade in on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.text-teal    { color: var(--accent-teal); }
.text-green   { color: var(--accent-green); }
.text-purple  { color: var(--accent-purple); }
.text-orange  { color: var(--accent-orange); }
.text-gold    { color: var(--accent-gold); }
.text-red     { color: var(--accent-red); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.78rem; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* ============================================================
   COMPARISON TABLE
   ============================================================ */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.compare-table th,
.compare-table td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card);
}

.compare-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

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

.compare-table tr:hover td {
  background: rgba(0, 212, 255, 0.03);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(8, 12, 24, 0.98);
    backdrop-filter: blur(20px);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
  }
  .nav-toggle { display: flex; }
  .modality-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }
  .hero { padding: 0 1rem; }
  .hero h1 { font-size: 2rem; }
  .page-hero { padding: 4rem 1rem 2rem; }
}
