/* =========================================================
   GOOGLE MATERIAL LIGHT DESIGN SYSTEM (xNET MEDICAL)
   ========================================================= */

/* --- ROOT VARIABLES & COLOR PALETTE --- */
:root {
  /* Google Palette */
  --google-blue: #1a73e8;
  --google-blue-hover: #1765cc;
  --google-blue-light: #e8f0fe;
  --google-red: #ea4335;
  --google-red-light: #fce8e6;
  --google-yellow: #fbbc04;
  --google-yellow-light: #fef7e0;
  --google-green: #34a853;
  --google-green-light: #e6f4ea;
  
  /* Medical / Accent Tokens */
  --teal-primary: #0d9488;
  --teal-light: #ccfbf1;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-text: #064e3b;

  /* Neutral Surface & Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-elevated: #f1f3f4;
  --bg-slate: #f8fafc;
  
  /* Typography Colors */
  --text-primary: #202124;
  --text-secondary: #3c4043;
  --text-subtle: #5f6368;
  --text-muted: #475569;
  
  /* Borders & Shadows */
  --border-color: #dadce0;
  --border-hover: #bdc1c6;
  --border-subtle: #e2e8f0;
  
  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-md: 0 1px 6px rgba(32, 33, 36, 0.28);
  --shadow-lg: 0 4px 12px rgba(32, 33, 36, 0.15);

  /* Monospace & Code Font Stack */
  --font-code: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', 'Courier New', monospace;
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- MONOSPACE & CODE TYPOGRAPHY --- */
code, pre, .code-text, kbd, samp {
  font-family: var(--font-code);
  font-size: 13px;
  background-color: var(--bg-elevated);
  color: var(--google-blue);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

pre {
  padding: 14px;
  overflow-x: auto;
  line-height: 1.45;
  margin: 12px 0;
}

pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text-primary);
}

/* --- HEADER & NAVIGATION --- */
#site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  transition: border-color 0.2s ease;
}

#site-header:hover {
  border-color: var(--border-hover);
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.logo-block h1 {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.2px;
}

#clock {
  font-family: var(--font-code);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
  background: var(--bg-secondary);
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#clock:hover {
  background: var(--google-blue-light);
  border-color: var(--google-blue);
  color: var(--google-blue);
}

/* --- GOOGLE MULTI-COLOR BRAND SPANS --- */
.g-blue   { color: var(--google-blue); }
.g-red    { color: var(--google-red); }
.g-yellow { color: var(--google-yellow); }
.g-green  { color: var(--google-green); }
.red-x    { color: var(--google-red); font-weight: 600; }

/* --- GLOBAL TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

h1 {
  text-align: center;
  font-size: 28px;
  margin: 24px 0 16px;
}

h2 {
  font-size: 20px;
  font-weight: 500;
  border-bottom: 2px solid var(--google-blue);
  padding-bottom: 8px;
  margin: 24px 0 16px 0;
}

h3 {
  font-size: 16px;
  font-weight: 500;
}

h4 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
  text-transform: capitalize;
}

h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--google-blue);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h5::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1rem;
  background-color: var(--google-blue);
  border-radius: 2px;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

strong, b {
  color: var(--text-primary);
  font-weight: 600;
}

em, i {
  color: var(--text-muted);
  font-style: italic;
}

ul, ol {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* --- LAYOUT CONTAINERS & CARDS --- */
.container {
  width: 100%;
  margin: 24px auto;
}

#home {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 850px;
  margin: 0 auto;
}

.parent {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.parent .section {
  flex: 1 1 320px;
  max-width: 600px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.parent .section:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.new-tools, .announcements {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--google-blue);
  border-radius: 8px;
  padding: 16px 20px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.new-tools:hover, .announcements:hover {
  border-color: var(--border-hover);
  border-left-color: var(--google-blue-hover);
  box-shadow: var(--shadow-sm);
}

.new-tools h3, .announcements h3 {
  font-size: 15px;
  color: var(--google-blue);
  margin-bottom: 8px;
}

.new-tools ul {
  margin-left: 20px;
  color: var(--text-secondary);
}

.new-tools li, .announcements li {
  transition: color 0.15s ease;
}

.new-tools li:hover, .announcements li:hover {
  color: var(--text-primary);
}

/* --- FORM CONTROLS & SEARCH INPUTS --- */
input[type="number"], 
input[type="text"], 
select {
  font-family: var(--font-code);
  width: 100%;
  max-width: 480px;
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 22px; /* Google Pill Shape */
  margin: 8px 0 16px 0;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

select:hover, 
input[type="number"]:hover, 
input[type="text"]:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md);
  background-color: var(--bg-secondary);
}

select:focus, 
input[type="number"]:focus, 
input[type="text"]:focus {
  border-color: transparent;
  box-shadow: var(--shadow-md);
  background: var(--bg-primary);
}

button {
  height: 36px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background: var(--google-blue);
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: var(--google-blue-hover);
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.35);
  transform: translateY(-1px);
}

button:active {
  background: #1557b0;
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* --- TABLES & CLINICAL CALCULATOR PANELS --- */
.calculator {
  max-width: 650px;
  margin: 20px auto;
  padding: 24px;
  border-radius: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.calculator:hover {
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

th, td {
  padding: 12px 16px;
  text-align: left;
}

th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

td {
  font-family: var(--font-code);
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

tr:hover td {
  background: var(--google-blue-light);
  color: var(--google-blue);
}

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

#cvsa-display {
  font-family: var(--font-code);
  margin-top: 16px;
  font-size: 15px;
  font-weight: 500;
  padding: 16px;
  border-radius: 8px;
  background: var(--google-blue-light);
  border-left: 4px solid var(--google-blue);
  color: var(--google-blue);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

#cvsa-display:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

#estroDisplay, #progDisplay {
  font-family: var(--font-code);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#estroDisplay:hover, #progDisplay:hover {
  border-color: var(--google-blue);
  box-shadow: var(--shadow-sm);
}

/* Status Indicator Highlights */
.score     { font-family: var(--font-code); color: var(--google-blue); font-weight: 500; }
.low       { font-family: var(--font-code); color: var(--google-red); font-weight: 500; }
.phase     { font-family: var(--font-code); color: var(--google-green); font-weight: 500; }
.high      { font-family: var(--font-code); color: #8e24aa; font-weight: 500; }
.very-high { font-family: var(--font-code); color: #e37400; font-weight: 500; }
.error     { font-family: var(--font-code); color: var(--google-red); font-weight: 500; }

/* Dynamic Interactive Tool Container */
.tool {
  box-sizing: border-box;
  width: 100%;
  max-width: 850px;
  margin: 20px auto;
  padding: 24px;
  background-color: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow-wrap: break-word;
  word-break: break-word;
}

.tool.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Tool Header Badge Styling */
.tool h3 {
  color: var(--teal-primary);
  background-color: var(--teal-light);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

/* --- RADIOLOGY & CLINICAL CASE SCENARIOS --- */
.question-answer {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.question-answer:hover {
  transform: translateY(-2px);
  border-color: var(--google-blue);
  box-shadow: var(--shadow-md);
}

.question-answer h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--google-blue);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-answer p strong {
  font-family: var(--font-code);
  color: var(--google-blue);
  background: var(--google-blue-light);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(26, 115, 232, 0.2);
}

.question-answer ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 8px;
}

.question-answer li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.question-answer > ul > li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--google-blue);
  font-weight: bold;
}

/* Specific Pathology Highlights */
.question-answer:nth-of-type(1) li strong {
  font-family: var(--font-code);
  color: var(--google-red);
  background: var(--google-red-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.question-answer:nth-of-type(2) li strong {
  font-family: var(--font-code);
  color: var(--google-green);
  background: var(--google-green-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.question-answer em {
  font-style: normal;
  font-weight: 500;
  color: #e37400;
  background: var(--google-yellow-light);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Nested Justification Lists */
.question-answer ul ul {
  margin-top: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
}

.question-answer ul ul li {
  padding-left: 12px;
  font-size: 13px;
  margin-bottom: 4px;
}

.question-answer ul ul li::before {
  content: "";
}

.question-answer ul ul li em {
  font-family: var(--font-code);
  font-size: 12px;
  color: var(--text-subtle);
  background: transparent;
}

cite {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--text-subtle);
  font-style: normal;
  margin-left: 4px;
  opacity: 0.7;
}

cite:hover {
  opacity: 1;
  color: var(--google-blue);
}

/* --- CLINICAL CASE VIGNETTES & MCQ CARDS --- */
#mcq2 {
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--bg-slate);
  border-radius: 10px;
  overflow-x: hidden;
}

#mcq2 > h3 {
  color: #1e3a8a;
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 10px;
}

.question-container {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  padding: 18px 20px;
  background-color: var(--bg-primary);
  border-left: 5px solid var(--google-blue);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.question-container h3 {
  color: #1e40af;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.question-container > p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.options {
  background-color: #f1f5f9;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.options p {
  color: var(--text-primary);
  margin: 6px 0;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.answer-section {
  background-color: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  border-radius: 6px;
  padding: 12px 16px;
}

.answer-section p:first-child {
  color: #15803d;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 6px;
}

.answer-section p:last-child {
  color: var(--emerald-text);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 0;
}

/* --- PROMOTIONAL & FOOTER CARDS --- */
#recent-tools {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  margin: 32px 0;
}

.section-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.disclaimer {
  font-size: 12px;
  color: var(--google-red);
  font-style: italic;
  margin-bottom: 16px;
}

.ad-item {
  list-style: none;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ad-item:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.ad-title {
  font-weight: 500;
  font-size: 15px;
  color: var(--google-blue);
  margin-bottom: 4px;
}

.subject {
  color: var(--google-green);
  font-weight: 500;
}

.contact {
  font-family: var(--font-code);
  color: var(--text-subtle);
  display: block;
  margin-top: 8px;
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding: 20px 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  font-size: 13px;
  color: var(--text-subtle);
}

#site-info .info-block {
  max-width: 240px;
  line-height: 1.5;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  #site-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .logo-block {
    flex-direction: column;
  }

  button, select, input[type="number"], input[type="text"] {
    width: 100%;
    max-width: 100%;
  }

  .parent .section {
    flex: 1 1 100%;
  }

  footer {
    flex-direction: column;
    gap: 16px;
  }
}




/* ==========================================================================
   Global & Container Scoping
   ========================================================================== */

/* Universal box-sizing reset applied globally */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Master container styling */
.section#sirius {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 960px;
  margin: 1.5rem auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
}

/* Section Headings */
.section#sirius h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.section#sirius h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.section#sirius h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background-color: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 6px 6px 0;
}

/* ==========================================================================
   Dropdown Selection Box
   ========================================================================== */

#cfxriaeMenu {
  width: 100%;
  max-width: 400px;
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.5rem;
}

#cfxriaeMenu:hover {
  border-color: #94a3b8;
}

#cfxriaeMenu:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   Diagnostic Tool View & Image Presentation
   ========================================================================== */

.cxr-view {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.cxr-view img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  margin: 1rem auto 1.5rem auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Article Content Panels & Lists
   ========================================================================== */

article.pneumothorax-type,
article.radiograph-category,
article.pathophysiology-section,
article.interpretation-section,
article.primary-tb-section,
article.post-primary-tb-section,
article.types-section,
article.features-section,
article.multifocal-systemic-section,
article.manifestations-section,
article.imaging-clinical-effects-section {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  border-bottom: none;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

article p {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #334155;
}

/* Bullet list typography and layout */
article ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style-type: disc;
}

article ul li {
  margin-bottom: 0.5rem;
  color: #334155;
  font-size: 0.95rem;
}

article ul li:last-child {
  margin-bottom: 0;
}

article ul li strong {
  color: #0f172a;
}
