/* ==========================================================================
   CTC COURSE DETAIL PAGES — shared scoped styles
   --------------------------------------------------------------------------
   Used by every page under /ctc-calculator/ : java-fs-calc.html,
   python-fs-calc.html, mern-calc.html, mean-calc.html, devops-calc.html,
   data-science-calc.html.

   Paste this block at the END of assets/css/ctc-calculator.css.
   That file is already linked by java-fs-calc.html, so nothing else to do
   there. For the other five pages, add this line next to style.css:

       <link rel="stylesheet" href="../assets/css/ctc-calculator.css" />

   Everything is namespaced under .ctc-detail-page, so none of it can leak
   into or override any other page.

   TO SPIN UP A NEW COURSE PAGE
   1. Copy java-fs-calc.html and swap the copy.
   2. Optionally add a course modifier on <main> to change the accent:
        <main class="ctc-detail-page ctc-detail-page--python">
      Leave it off to keep the Rays red used on the Java page.
   ========================================================================== */

/* ---------- Design tokens ---------- */

.ctc-detail-page {
  /* Accent — one line changes the whole page. See modifiers below. */
  --cd-accent-rgb: 255, 60, 56;

  --cd-accent: rgb(var(--cd-accent-rgb));
  --cd-accent-soft: rgba(var(--cd-accent-rgb), 0.06);
  --cd-accent-line: rgba(var(--cd-accent-rgb), 0.28);
  --cd-accent-ring: rgba(var(--cd-accent-rgb), 0.18);

  --cd-page: #fff;
  --cd-surface: #fff;
  --cd-surface-2: #f7f8fa;
  --cd-border: #ececec;
  --cd-border-soft: #f1f2f4;

  --cd-heading: #111;
  --cd-body: #555961;
  --cd-muted: #6b7280;

  --cd-radius: 14px;
  --cd-radius-sm: 10px;
  --cd-shadow:
    0 1px 2px rgba(16, 12, 47, 0.04), 0 14px 34px -20px rgba(16, 12, 47, 0.28);
  --cd-shadow-lift:
    0 1px 2px rgba(16, 12, 47, 0.05), 0 24px 48px -24px rgba(16, 12, 47, 0.34);

  position: relative;
  background: var(--cd-page);
  color: var(--cd-body);
}

/* ---------- Per-course accents ----------
   Colours match the track cards on ctc-calculator.html. Apply on <main>. */

.ctc-detail-page--java {
  --cd-accent-rgb: 245, 124, 0;
}
.ctc-detail-page--python {
  --cd-accent-rgb: 37, 99, 235;
}
.ctc-detail-page--mern {
  --cd-accent-rgb: 6, 182, 212;
}
.ctc-detail-page--mean {
  --cd-accent-rgb: 153, 70, 255;
}
.ctc-detail-page--devops {
  --cd-accent-rgb: 22, 163, 74;
}
.ctc-detail-page--datascience {
  --cd-accent-rgb: 227, 24, 77;
}

/* ---------- Dark mode (site toggles html.dark-mode) ---------- */

html.dark-mode .ctc-detail-page {
  --cd-accent-soft: rgba(var(--cd-accent-rgb), 0.14);
  --cd-page: #0d0d0d;
  --cd-surface: #121212;
  --cd-surface-2: #171717;
  --cd-border: #2a2e35;
  --cd-border-soft: #21252b;
  --cd-heading: #e6eaf0;
  --cd-body: #a9b1bd;
  --cd-muted: #8b93a1;
  --cd-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -20px rgba(0, 0, 0, 0.7);
  --cd-shadow-lift:
    0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 48px -24px rgba(0, 0, 0, 0.8);
}

/* ---------- Typography ---------- */

.ctc-detail-page h2,
.ctc-detail-page h3,
.ctc-detail-page h5 {
  color: var(--cd-heading);
  letter-spacing: -0.02em;
}

.ctc-detail-page p {
  color: var(--cd-body);
}

.ctc-detail-page .cd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 40px;
  background: var(--cd-accent-soft);
  border: 1px solid var(--cd-accent-line);
  color: var(--cd-accent) !important;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.ctc-detail-page .cd-eyebrow i {
  font-size: 12px;
}

/* ---------- Level ladder ----------
   Three bars that fill by seniority: entry / mid / senior. Decorative only,
   so mark it aria-hidden in the markup. */

.ctc-detail-page span.cd-ladder {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  flex: 0 0 auto;
}

.ctc-detail-page .cd-ladder i {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: var(--cd-border);
}

.ctc-detail-page .cd-ladder i:nth-child(1) {
  height: 6px;
}
.ctc-detail-page .cd-ladder i:nth-child(2) {
  height: 10px;
}
.ctc-detail-page .cd-ladder i:nth-child(3) {
  height: 14px;
}

.ctc-detail-page .cd-ladder--1 i:nth-child(-n + 1),
.ctc-detail-page .cd-ladder--2 i:nth-child(-n + 2),
.ctc-detail-page .cd-ladder--3 i:nth-child(-n + 3) {
  background: var(--cd-accent);
}

/* ---------- Surfaces ---------- */

.ctc-detail-page .cd-panel,
.ctc-detail-page .cd-card,
.ctc-detail-page .cd-metric,
.ctc-detail-page .cd-salary {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
}

.ctc-detail-page .cd-panel {
  position: relative;
  overflow: hidden;
  box-shadow: var(--cd-shadow);
}

.ctc-detail-page .cd-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--cd-accent) 0%,
    var(--cd-accent-line) 45%,
    transparent 100%
  );
}

/* ---------- Hero ---------- */

.ctc-detail-page .cd-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cd-radius);
  overflow: hidden;
  border: 1px solid var(--cd-border);
  box-shadow: var(--cd-shadow);
}

.ctc-detail-page .cd-hero img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}

.ctc-detail-page .cd-hero:hover img {
  transform: scale(1.04);
}

.ctc-detail-page .cd-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cd-accent-soft);
  border: 1px solid var(--cd-accent-line);
  color: var(--cd-accent);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.ctc-detail-page .cd-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cd-accent);
  flex: 0 0 6px;
}

.ctc-detail-page .cd-panel h5 {
  font-size: 20px;
  line-height: 1.45;
}

/* ---------- Metric boxes ---------- */

.ctc-detail-page .cd-metric {
  height: 100%;
  padding: 16px 18px;
  transition:
    border-color 0.25s ease,
    transform 0.25s ease;
}

.ctc-detail-page .cd-metric:hover {
  border-color: var(--cd-accent-line);
  transform: translateY(-3px);
}

.ctc-detail-page .cd-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ctc-detail-page .cd-metric span:not(.cd-ladder) {
  display: block;
  color: var(--cd-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.ctc-detail-page .cd-metric strong {
  display: block;
  color: var(--cd-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tabs ---------- */

.ctc-detail-page .cd-tabs {
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--cd-surface-2);
  border: 1px solid var(--cd-border);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.ctc-detail-page .cd-tabs::-webkit-scrollbar {
  display: none;
}

.ctc-detail-page .cd-tabs .nav-item {
  flex: 1 1 0;
  min-width: max-content;
}

.ctc-detail-page .cd-tabs .nav-link {
  width: 100%;
  border: 0;
  border-radius: 999px;
  color: var(--cd-muted);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  white-space: nowrap;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.ctc-detail-page .cd-tabs .nav-link:hover {
  color: var(--cd-heading);
  background: var(--cd-surface);
}

.ctc-detail-page .cd-tabs .nav-link.active,
.ctc-detail-page .cd-tabs .nav-link.active:hover {
  background: var(--cd-accent);
  color: #fff;
  box-shadow: 0 6px 16px -6px var(--cd-accent-ring);
}

.ctc-detail-page .tab-pane {
  padding-top: 26px;
}

/* ---------- Icon lists ---------- */

.ctc-detail-page .cd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ctc-detail-page .cd-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid var(--cd-border-soft);
}

.ctc-detail-page .cd-list li:first-child {
  padding-top: 0;
}

.ctc-detail-page .cd-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ctc-detail-page .cd-list span {
  color: var(--cd-body);
  line-height: 1.6;
}

.ctc-detail-page .cd-list b {
  color: var(--cd-heading);
  font-weight: 600;
}

.ctc-detail-page .cd-list i {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--cd-accent-soft);
  border: 1px solid var(--cd-accent-line);
  color: var(--cd-accent);
  font-size: 14px;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.ctc-detail-page .cd-list li:hover i {
  background: var(--cd-accent);
  color: #fff;
}

/* ---------- Task cards ---------- */

.ctc-detail-page .cd-card {
  height: 100%;
  padding: 24px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.ctc-detail-page .cd-card:hover {
  transform: translateY(-4px);
  border-color: var(--cd-accent-line);
  box-shadow: var(--cd-shadow-lift);
}

.ctc-detail-page .cd-card h5 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  margin-bottom: 16px;
}

.ctc-detail-page .cd-card h5 i {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--cd-accent-soft);
  border: 1px solid var(--cd-accent-line);
  color: var(--cd-accent);
  font-size: 15px;
}

.ctc-detail-page .cd-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ctc-detail-page .cd-card li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: var(--cd-body);
  font-size: 14.5px;
  line-height: 1.65;
}

.ctc-detail-page .cd-card li:last-child {
  margin-bottom: 0;
}

.ctc-detail-page .cd-card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--cd-accent-line);
  transform: rotate(45deg);
}

/* ---------- Salary cards ---------- */

.ctc-detail-page .cd-salary {
  height: 100%;
  padding: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--cd-shadow);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.ctc-detail-page .cd-salary:hover {
  transform: translateY(-5px);
  border-color: var(--cd-accent-line);
  box-shadow: var(--cd-shadow-lift);
}

/* Left rail fills in as the level goes up */
.ctc-detail-page .cd-salary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--cd-accent) 0%,
    var(--cd-accent-line) 100%
  );
}

.ctc-detail-page .cd-salary--mid::before {
  background: linear-gradient(
    180deg,
    var(--cd-accent) 55%,
    var(--cd-accent-line) 100%
  );
}

.ctc-detail-page .cd-salary--senior::before {
  background: var(--cd-accent);
}

.ctc-detail-page .cd-salary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ctc-detail-page .cd-salary h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.ctc-detail-page .cd-salary > p {
  color: var(--cd-muted) !important;
  font-size: 14.5px;
  line-height: 1.65;
}

.ctc-detail-page .cd-salary-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.ctc-detail-page .cd-salary-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 10px;
  margin: 0 -10px;
  border-radius: var(--cd-radius-sm);
  border-top: 1px solid var(--cd-border-soft);
  transition: background 0.2s ease;
}

.ctc-detail-page .cd-salary-list li:hover {
  background: var(--cd-surface-2);
}

.ctc-detail-page .cd-salary-list span {
  color: var(--cd-muted);
  font-size: 14px;
}

.ctc-detail-page .cd-salary-list strong {
  color: var(--cd-heading);
  text-align: right;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Accessibility ---------- */

.ctc-detail-page a:focus-visible,
.ctc-detail-page button:focus-visible {
  outline: 2px solid var(--cd-accent);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .ctc-detail-page *,
  .ctc-detail-page *::before,
  .ctc-detail-page *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 767.98px) {
  .ctc-detail-page .cd-tabs {
    border-radius: 14px;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .ctc-detail-page .cd-tabs .nav-item {
    flex: 1 1 auto;
  }

  .ctc-detail-page .cd-tabs .nav-link {
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .ctc-detail-page .cd-salary-list li {
    display: block;
  }

  .ctc-detail-page .cd-salary-list strong {
    display: block;
    text-align: left;
    margin-top: 3px;
  }

  .ctc-detail-page .cd-card,
  .ctc-detail-page .cd-salary {
    padding: 20px;
  }
}
