@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap");

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --navy: #0d1f3c;
  --navy-mid: #1a3560;
  --teal: #0a7b72;
  --teal-light: #0d9e93;
  --teal-faint: #e8f7f6;
  --surface: #ffffff;
  --surface-alt: #f6f8fb;
  --border: #dde3ed;
  --text-1: #0d1f3c;
  --text-2: #4a6282;
  --text-3: #8fa3be;
  --success: #0a7b5e;
  --danger: #c0392b;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm:
    0 1px 3px rgba(13, 31, 60, 0.07), 0 1px 2px rgba(13, 31, 60, 0.04);
  --shadow-md:
    0 4px 14px rgba(13, 31, 60, 0.09), 0 2px 6px rgba(13, 31, 60, 0.05);
  --shadow-lg:
    0 8px 28px rgba(13, 31, 60, 0.12), 0 4px 10px rgba(13, 31, 60, 0.07);
}

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--surface-alt);
  -webkit-font-smoothing: antialiased;
}

/* ── Header band ───────────────────────────────────────────── */
/* Only the top-level logo container gets the dark band */
.container-fluid > .div-menu {
  display: flex;
  align-items: center;
  padding: 14px 2.5%;
  background: var(--navy);
  margin: 0;
}

/* Nav panel labels reuse div-menu class — keep them transparent */
.nav-link .div-menu {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

/* ── Title & intro ─────────────────────────────────────────── */
.titles {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 2.5% 4px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.introduction-section {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 2.5% 20px;
  line-height: 1.65;
}

/* ── Navigation ────────────────────────────────────────────── */
.navbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 2.5%;
}

.nav-link {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2) !important;
  padding: 14px 16px !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 12px;
  border-bottom: 2px solid transparent !important;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.nav-link:hover {
  color: var(--navy) !important;
}

.nav-link.active {
  color: var(--teal) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--teal) !important;
  background: transparent !important;
}

/* ── Layout ────────────────────────────────────────────────── */
.container-1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  gap: 20px;
  padding: 16px 2.5%;
  background: var(--surface-alt);
  align-items: stretch;
}

.row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}

/* ── Input cards ───────────────────────────────────────────── */
.column {
  padding: 16px;
  box-sizing: border-box;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.column-header {
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.col-md-6 {
  flex: 1;
  min-width: 350px;
}

/* ── Form elements ─────────────────────────────────────────── */
.clinical-data {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 3px;
  line-height: 1.3;
}

/* ── Clinical data grid layout ──────────────────────────────── */
.clinical-grid-compact {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.clinical-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clinical-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 8px;
}

.extra-info {
  font-size: 11px;
  color: var(--text-3);
  margin: 0 0 4px;
}

.input-container {
  overflow-x: auto;
}

.form-control,
.selectize-input,
input[type="number"] {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 13px !important;
  color: var(--text-1) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  transition: border-color 0.15s !important;
}

.form-control:focus,
.selectize-input.focus {
  border-color: var(--teal) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(10, 123, 114, 0.12) !important;
}

/* Slider track */
.irs--shiny .irs-bar {
  background: var(--teal) !important;
  border-top-color: var(--teal) !important;
  border-bottom-color: var(--teal) !important;
}

.irs--shiny .irs-handle {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
}

.irs--shiny .irs-from,
.irs--shiny .irs-to,
.irs--shiny .irs-single {
  background: var(--navy) !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 11px !important;
}

/* ── Genomic checkboxes ────────────────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 20px;
  padding: 12px 0;
}

.genes {
  margin: 0;
  padding: 0;
}

/* Simple beautiful checkbox styling */
.genes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  cursor: pointer;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.genes label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s ease;
  min-height: 32px;
  margin: 0;
  width: 100%;
}

.genes label:hover {
  background: var(--surface-alt);
  border-color: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(10, 123, 114, 0.1);
}

.genes input[type="checkbox"]:checked + label {
  background: rgba(10, 123, 114, 0.08);
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 600;
}

.genes input[type="checkbox"]:focus + label {
  outline: 2px solid rgba(10, 123, 114, 0.3);
  outline-offset: 2px;
}

/* Toggle switch */
.form-check-input:checked {
  background-color: var(--teal) !important;
  border-color: var(--teal) !important;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-success {
  background: var(--teal) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em !important;
  padding: 8px 22px !important;
  transition:
    background 0.15s,
    transform 0.1s,
    box-shadow 0.15s !important;
  box-shadow: 0 2px 6px rgba(10, 123, 114, 0.25) !important;
}

.btn-success:hover {
  background: var(--teal-light) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(10, 123, 114, 0.3) !important;
}

.btn-success:active {
  transform: translateY(0) !important;
}

.btn-warning {
  background: transparent !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-2) !important;
  padding: 8px 22px !important;
  transition:
    border-color 0.15s,
    color 0.15s !important;
}

.btn-warning:hover {
  border-color: var(--text-2) !important;
  color: var(--text-1) !important;
  background: transparent !important;
}

/* ── Results area ──────────────────────────────────────────── */
.main-page {
  width: 100%;
}

.double-graph-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 20px;
  margin-bottom: 20px;
}

.survival-graph-container {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 4px;
}

.risk-bar-container {
  flex: 1;
  max-height: 160px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 4px;
}

/* ── Score cards ───────────────────────────────────────────── */
.score-info-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 12px;
  margin-top: 4px;
}

.score-info {
  flex: 1;
  padding: 20px 24px;
  box-sizing: border-box;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.score-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--teal));
}

.score-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.score-value {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--navy);
  margin: 4px 0 10px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.median-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 2px;
}

.lower-risk {
  color: var(--success);
  background: rgba(10, 123, 94, 0.08);
}

.higher-risk {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.08);
}

/* ── Risk class text (unused but kept) ─────────────────────── */
.risk-class-text {
  display: flex;
  text-align: center;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  font-size: calc(1vh + 1vw);
  border: none;
  padding: 20px;
  margin: 10px auto;
  width: 50%;
  border-radius: var(--radius);
  background-color: var(--surface-alt);
  box-sizing: border-box;
}

.risk-class-text p {
  margin: 0;
  width: 100%;
}

.low-risk {
  color: var(--success);
}
.moderate-risk {
  color: #d97706;
}
.high-risk {
  color: #ea580c;
}
.very-high-risk {
  color: var(--danger);
}

/* ── Survival table ────────────────────────────────────────── */
.survival-table {
  width: 60%;
  margin: 16px auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.survival-table table {
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
}

.survival-table thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 10px 16px;
  border: none;
}

.survival-table tbody td {
  padding: 10px 16px;
  border-color: var(--border);
}

/* ── Help section ──────────────────────────────────────────── */
.help-section {
  font-size: 14px;
  color: var(--text-2);
  margin: 28px 2.5%;
  line-height: 1.65;
  max-width: 820px;
}

.help-section h3,
.help-section-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 32px;
  margin-bottom: 10px;
}

/* override the inline-styled divs used as headings in help section */
.help-section > div:first-child,
.help-section > div[style*="font-size:30px"] {
  font-family: "Playfair Display", Georgia, serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--navy) !important;
  margin-top: 32px !important;
  letter-spacing: -0.01em;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-header {
  background: var(--navy);
  color: #fff;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title {
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 15px;
}

.modal-header .btn-close {
  filter: invert(1);
}

.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
}

.modal-body {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  padding: 20px 24px;
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress-bar {
  background-color: var(--teal) !important;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ── Input sidebar / results layout ───────────────────────── */

/* Full-width input section with two-column layout */
.container-1 > .row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 20px;
  width: 100% !important;
  flex: none;
  align-self: stretch;
}

/* Two-column layout for inputs */
.container-1 > .row > .col-md-6 {
  flex: 1;
  min-width: 300px;
  width: auto;
}

/* Results section - full width below */
.container-1 > div:last-child {
  flex: none;
  width: 100%;
}

/* Kill excess vertical space below the content */
body {
  overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .clinical-grid-compact {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .clinical-grid-compact {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .col-md-6 {
    min-width: 280px;
  }
}

@media (max-width: 480px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
  
  .col-md-6 {
    min-width: 100%;
  }
}
