/*
 * ITR SCA Portal — Case Tabs Styles
 * Visual structure follows the original GP Pathway gp-cases.css patterns,
 * restyled to match the teal/rounded design language used elsewhere in
 * this plugin. New blocks (nav bar, completion bar) match the same tokens.
 */

/* ── Case view page: breadcrumb + title header ──────────────────────────── */
#itr-sca-cases {
/* Font Families */
  --font-heading: "Montserrat", sans-serif;
  --font-body-1:  "Poppins", sans-serif;
  --font-body-2:  "Poppins", sans-serif;
  --font-body-3:  "Poppins", sans-serif;
  --itr-font:     "Poppins", sans-serif;

  /* H1 */
  --h1-size:   38px;
  --h1-line:   50px;
  --h1-weight: 700;

  /* H2 */
  --h2-size:   32px;
  --h2-line:   42px;
  --h2-weight: 700;

  /* H3 */
  --h3-size:   26px;
  --h3-line:   36px;
  --h3-weight: 700;

  /* H4 */
  --h4-size:   20px;
  --h4-line:   28px;
  --h4-weight: 700;

  /* Body 1 */
  --body1-size: 18px;
  --body1-line: 26px;

  /* Body 2 */
  --body2-size: 16px;
  --body2-line: 24px;

  /* Body 3 */
  --body3-size: 14px;
  --body3-line: 24px;
}

/* Laptop */
@media (max-width: 1366px) {
  :root {
    --h1-size:    38px;
    --h2-size:    32px;
    --h3-size:    26px;
    --h4-size:    20px;
    --body1-size: 18px;
    --body2-size: 16px;
    --body3-size: 14px;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --h1-size:    32px;
    --h1-line:    38px;
    --h2-size:    26px;
    --h2-line:    36px;
    --h3-size:    22px;
    --h3-line:    28px;
    --h4-size:    18px;
    --h4-line:    24px;
    --body1-size: 16px;
    --body2-size: 14px;
    --body3-size: 12px;
  }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --h1-size:    26px;
    --h1-line:    32px;
    --h2-size:    22px;
    --h2-line:    32px;
    --h3-size:    18px;
    --h3-line:    24px;
    --h4-size:    18px;
    --h4-line:    24px;
    --body1-size: 16px;
    --body2-size: 14px;
    --body3-size: 12px;
  }
}

.itr-case-view {
  max-width: 100%;
  margin: 0 auto;
  padding: 0px 10px 50px 10px;
}

.itr-case-view-banner{
  display: flex;
    justify-content: center;
    align-items: center;

  padding: 50px 10px;
    background:
        radial-gradient(
            circle at 100% 50%,
            rgba(214, 241, 255, 0.9) 0%,
            rgba(214, 241, 255, 0.4) 30%,
            transparent 65%
        ),
        linear-gradient(
            90deg,
            #F8FCFD 0%,
            #FAFDFE 35%,
            #FCFEFE 65%,
            #FFFFFF 100%
        );
}

.itr-case-view-inner-banner{
  align-items: center;
    width: 1280px;
    align-content: center;
}
.itr-case-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--body2-size);
  color: var(--itr-muted, #666);
  margin-bottom: 18px;
}

.itr-case-breadcrumb a {
  color: #3e3e3e;
  text-decoration: none;
  font-size: 16px;
}

.itr-case-breadcrumb a:hover {
  text-decoration: underline;
}

.itr-case-header {
  margin-bottom: 24px;
  justify-content: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.itr-case-label {
  text-align: center;
    background: #1CBCCF1A;
    border-radius: 100px;
    padding: 14px 22px;
    width: 110px;
    color: #0C4A68;
    font-size: var(--body2-size);
    font-weight: 400;
  /* font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--itr-teal, #1B6B7B); */
  margin-bottom: 6px;
}

.itr-case-title {
  font-size: var(--h1-size);
  font-weight: 700;
  margin: 0;
  color: #0F4C6A;
}

/* ── Admin: case/category edit screen fields ──────────────────────────────
 * This block is intentionally separate from the frontend styles below.
 * .gp-case-image-preview previously had NO size constraint at all, so an
 * uploaded SVG (which has no fixed intrinsic pixel size — it scales to
 * fill whatever box contains it) rendered at full document width instead
 * of as a small thumbnail. Fixed below.
 * ────────────────────────────────────────────────────────────────────── */

.gp-case-admin-field {
  margin-bottom: 16px;
}

.gp-case-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.gp-case-image-field {
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.gp-case-image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #f6f7f7;
  margin: 8px 0;
  overflow: hidden;
}

.gp-case-image-preview img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.gp-case-image-field .button {
  margin-right: 6px;
  margin-top: 4px;
}

.gp-case-admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #dcdcde;
  margin-bottom: 20px;
}

.gp-case-admin-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-size: var(--body3-size);
  font-weight: 600;
  cursor: pointer;
  color: #50575e;
}

.gp-case-admin-tab.is-active {
  color: #1B6B7B;
  border-bottom-color: #1B6B7B;
}

.gp-case-admin-panel {
  display: none;
}

.gp-case-admin-panel.is-active {
  display: block;
}

.gp-case-admin-section-title {
  font-size: var(--body3-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #50575e;
  margin: 20px 0 10px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f1;
}

.gp-case-admin-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ── Frontend case-tabs styles ─────────────────────────────────────────── */

.gp-case-wrapper {
  font-family: var(--itr-font, 'Segoe UI', system-ui, sans-serif);
  color: var(--itr-text, #1a1a2e);
  max-width: 960px;
  margin: 0 auto;
}

/* ── Tabs row ───────────────────────────────────────────────────────────── */
.gp-case-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--itr-border, #d0dde0);
  margin-bottom: 24px;
  overflow-x: auto;
}

.gp-case-tab-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: var(--body3-size);
  font-weight: 600;
  color: var(--itr-muted, #666);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.gp-case-tab-button:hover {
  color: var(--itr-teal, #1B6B7B);
}

.gp-case-tab-button.is-active {
  color: var(--itr-teal, #1B6B7B);
  border-bottom-color: var(--itr-teal, #1B6B7B);
}

.gp-case-tab-img-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ── Panels ─────────────────────────────────────────────────────────────── */
.gp-case-tab-panel {
  display: none;
}

.gp-case-tab-panel.is-active {
  display: block;
  animation: gpCaseFadeIn 0.25s ease;
}

@keyframes gpCaseFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.gp-case-card {
  background: var(--itr-bg, #fff);
  border: 1px solid var(--itr-border, #d0dde0);
  border-radius: var(--itr-radius-lg, 12px);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.gp-case-card-title {
  font-size: var(--body3-size);
  font-weight: 700;
  color: var(--itr-text, #1a1a2e);
  margin: 0 0 8px;
}
.gp-case-content, .gp-case-content p, .gp-case-list, .gp-case-list li
{
  font-size: var(--body2-size);
  color: #161A26;
}

.gp-case-content {
  font-size: var(--body3-size);
  line-height: 1.6;
  color: var(--itr-text, #1a1a2e);
}

.gp-case-content p {
  margin: 0 0 10px;
}

.gp-case-content p:last-child {
  margin-bottom: 0;
}

.gp-case-list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--body3-size);
  line-height: 1.6;
}

.gp-case-list li {
  margin-bottom: 4px;
}

/* ── Doctor Notes layout ────────────────────────────────────────────────── */
.gp-case-doctor-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.gp-case-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.gp-case-patient-card {
  position: sticky;
  top: 20px;
}

.gp-case-patient-name {
  font-size: var(--body2-size);
  font-weight: 700;
  color: var(--itr-teal, #1B6B7B);
}

.gp-case-patient-age {
  font-size: var(--body3-size);
  color: var(--itr-muted, #666);
  margin-bottom: 12px;
}

.gp-case-divider {
  height: 1px;
  background: var(--itr-border, #d0dde0);
  margin: 14px 0;
}

.gp-case-observation-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--body3-size);
  padding: 5px 0;
}

.gp-case-observation-row span {
  color: var(--itr-muted, #666);
}

/* ── Patient Narrative layout ───────────────────────────────────────────── */
.gp-case-ice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.gp-case-ice-grid .gp-case-card {
  margin-bottom: 0;
}

.gp-case-red-flag-card {
  background: #fdf3ed;
  border-color: #f0cba8;
}

.gp-case-red-flag-icon-wrap {
  margin-bottom: 8px;
}

.gp-case-red-flag-img-icon {
  width: 24px;
  height: 24px;
}

.gp-case-red-flag-title {
  color: #c0612b;
}

/* ── Grading (Marking) layout ───────────────────────────────────────────── */
.gp-case-marking-intro {
  background: var(--itr-teal-light, #e8f4f6);
  border-color: var(--itr-teal-light, #e8f4f6);
}

.gp-case-marking-intro-first {
  font-weight: 600;
  font-size:var(--body3-size);
  margin-bottom: 6px;
}

.gp-case-marking-intro-grading {
  font-size: var(--body3-size);
  color: var(--itr-muted, #666);
}

.gp-case-marking-case-title {
  margin-top: 10px;
  font-size: var(--body2-size);
}

.gp-case-marking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.gp-case-score-pill {
  background: var(--itr-teal-light, #e8f4f6);
  color: var(--itr-teal, #1B6B7B);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.gp-case-indicator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.gp-case-mini-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--body3-size);
  font-weight: 700;
  margin: 0 0 10px;
}

.gp-case-positive-title {
  color: #1a8a4a;
}

.gp-case-negative-title {
  color: var(--itr-error, #c0392b);
}

.gp-case-indicator-heading-icon {
  width: 16px;
  height: 16px;
}

.gp-case-indicator-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gp-case-indicator-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--body3-size);
}

.gp-case-indicator-checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--itr-border, #d0dde0);
  border-radius: 4px;
  margin-top: 2px;
}

/* ── Themes layout ──────────────────────────────────────────────────────── */
.gp-case-issue-card {
  background: var(--itr-bg, #fff);
  border: 1px solid var(--itr-border, #d0dde0);
  border-radius: var(--itr-radius-lg, 12px);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.gp-case-issue-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.gp-case-issue-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--itr-teal, #1B6B7B);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.gp-case-issue-title {
  font-size: var(--body2-size);
  font-weight: 700;
  margin: 0;
}

.gp-case-issue-detail {
  margin-top: 12px;
}

.gp-case-issue-detail h4 {
  font-size: var(--body3-size);
  font-weight: 700;
  color: var(--itr-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0 0 6px;
}

.gp-case-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--itr-teal, #1B6B7B);
  color: #fff;
  text-decoration: none;
  font-size: var(--body3-size);
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 40px;
  margin-top: 8px;
}

.gp-case-cta:hover {
  background: var(--itr-teal-dark, #145462);
}

/* ── New: completion bar + Mark Complete button ─────────────────────────── */
.gp-case-completion-bar {
  display: flex;
  justify-content: flex-start;
  margin: 24px 0;
  gap: 20px;
}

.gp-case-mark-complete-btn {
  min-width: 220px;
}

.gp-case-completed-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a8a4a;
  background: #e6f5ec;
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: 700;
  font-size: var(--body3-size);
}

/* ── New: Next button nav bar ────────────────────────────────────────────── */
.gp-case-nav-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.gp-case-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .gp-case-doctor-grid {
    grid-template-columns: 1fr;
  }

  .gp-case-patient-card {
    position: static;
  }

  .gp-case-history-grid,
  .gp-case-ice-grid,
  .gp-case-indicator-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .gp-case-tabs {
    gap: 0;
  }

  .gp-case-tab-button {
    padding: 10px 12px;
    font-size: var(--body3-size);
  }

  /* .gp-case-tab-title {
    display: none;
  } */
.gp-case-completion-bar{
  flex-wrap: wrap;
    justify-content: center;
}
  .gp-case-card {
    padding: 16px 18px;
  }

  .gp-case-nav-bar {
    justify-content: stretch;
  }

  .gp-case-next-btn {
    width: 100%;
    justify-content: center;
  }
  .itr-case-breadcrumb{
    display: none;
  }
}
