/* ======================== CARD GRID (2-col) ======================== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-card {
  background: var(--bg-white);
  border-radius: var(--card-radius);
  padding: 18px 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  min-height: 110px;
}

.grid-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.grid-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.grid-card-arrow {
  position: absolute;
  top: 16px;
  right: 14px;
  font-size: 20px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ======================== LIST STACK ======================== */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-card {
  background: var(--bg-white);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.list-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.list-card-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-card-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.list-card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.list-card-arrow {
  font-size: 22px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ======================== INFORMATION LIST ELEMENT ======================== */
.info-card {
  padding: 16px;
  margin: 4px 0;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.info-card-header.clickable {
  cursor: pointer;
}

.info-card-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.info-card-icon-tinted {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.info-card-labels {
  flex: 1;
  min-width: 0;
}

.info-card-label {
  font-size: 14px;
  font-weight: bold;
  display: block;
  color: var(--text-primary);
}

.info-card-data {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
}

.expand-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  padding: 4px 8px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.info-card.expanded .expand-toggle {
  transform: rotate(90deg);
}

.info-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.info-card.expanded .info-card-body {
  max-height: 2000px;
}

.info-card-body-inner {
  padding-top: 12px;
}

.info-card-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.learn-more-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--primary-light);
  border: none;
  border-radius: 20px;
  color: var(--brand-teal);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.learn-more-btn:hover {
  background: rgba(58, 183, 141, 0.18);
}

/* ======================== DATA LIST ======================== */
.data-list {
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.data-list-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: default;
}

.data-list-row.clickable {
  cursor: pointer;
}

.data-list-main {
  font-size: 14px;
  font-weight: bold;
  flex: 1;
  color: var(--text-primary);
}

.data-list-secondary {
  font-size: 14px;
  color: var(--text-secondary);
  margin-right: 8px;
  max-width: 50%;
  text-align: right;
}

.data-list-chevron {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-tertiary);
  padding: 2px 6px;
}

.data-list-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}

/* ======================== FACTOR POST CARD ======================== */
.factor-card {
  width: 170px;
  min-width: 170px;
  height: 190px;
  padding: 16px;
  margin-right: 12px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.factor-card-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.factor-card-icon-tinted {
  width: 50px;
  height: 50px;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.factor-card-label {
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  margin-top: 6px;
  color: var(--text-primary);
}

.factor-card-data {
  font-size: 11px;
  text-align: left;
  width: 100%;
  margin-top: 8px;
  color: var(--text-secondary);
}

.factor-card-desc {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
}

/* ======================== ICON LIST ELEMENT (legacy) ======================== */
.icon-list-element {
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 3px solid var(--brand-teal);
}

.icon-list-element:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.icon-list-element img {
  height: 32px;
  width: 32px;
  object-fit: contain;
}

.icon-list-element-name {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--text-primary);
}

.icon-list-element-chevron {
  font-size: 20px;
  color: var(--text-tertiary);
}

/* ======================== SUMMARY ENTRY (legacy, for horizontal scroll if still used) ======================== */
.summary-entry {
  min-width: 160px;
  width: 44vw;
  max-width: 250px;
  height: 160px;
  padding: 20px 16px;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  background: var(--bg-white);
}

.summary-entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.summary-entry-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.summary-entry-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* ======================== HORIZONTAL SCROLL ======================== */
.horizontal-scroll-container {
  position: relative;
}

.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 4px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.horizontal-scroll::-webkit-scrollbar {
  height: 4px;
}

.horizontal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}

.remaining-badge {
  display: none;
}

/* ======================== NAV BUTTON ======================== */
.nav-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 8px;
}

.nav-btn.active {
  background: var(--selected-nav-bg);
  color: var(--brand-cyan);
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ======================== AGE ROW (legacy) ======================== */
.age-row {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  background: var(--bg-white);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.age-row-label {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-primary);
}

/* ======================== SPINNING CIRCLE ======================== */
.spinning-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinning-circle svg {
  transform: rotate(-90deg);
}

.spinning-circle .progress-ring {
  transition: stroke-dashoffset 0.1s;
}

.circle-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circle-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-tertiary);
}

.circle-value {
  font-size: 26px;
  font-weight: bold;
  color: var(--text-primary);
}

/* ======================== MODAL / DIALOG ======================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 24px 20px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
}

.modal-text {
  font-size: 15px;
  text-align: left;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.modal-close-btn {
  display: block;
  width: 100%;
  margin: 0 auto;
  padding: 10px 24px;
  background: var(--primary-light);
  border: none;
  border-radius: 10px;
  color: var(--brand-teal);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ======================== SEVERITY SECTION ======================== */
.severity-section {
  margin-bottom: 20px;
}

.severity-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--text-primary);
}

.severity-high {
  background: var(--severity-high-bg);
  border-left: 3px solid var(--risk-high);
}
.severity-medium {
  background: var(--severity-medium-bg);
  border-left: 3px solid var(--risk-medium);
}
.severity-low {
  background: var(--severity-low-bg);
  border-left: 3px solid var(--risk-low);
}

/* ======================== DISEASE CARD (Key Deviations) ======================== */
.disease-card {
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 3px solid var(--brand-teal);
}

.disease-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.disease-card-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-primary);
}

.disease-card-gene {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ======================== FOOD GROUP CARD ======================== */
.food-group-card {
  min-width: 240px;
  width: 260px;
  height: 220px;
  padding: 20px;
  border-radius: 20px;
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.food-group-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.food-group-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
}

.food-group-more {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-tertiary);
}

.food-group-preview {
  font-size: 13px;
  color: var(--text-secondary);
}

.food-group-preview-label {
  font-weight: bold;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.preferred-bg { background: rgba(34, 197, 94, 0.08); }
.avoid-bg { background: rgba(239, 68, 68, 0.08); }

/* ======================== DRUG AMOUNT / MED STATS ======================== */
.med-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.med-stat-card {
  padding: 16px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.med-stat-label {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
}

/* ======================== CANCER TABLE ======================== */
.cancer-indicator {
  padding: 14px 16px;
  border-radius: var(--card-radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cancer-indicator.no-cancer {
  background: rgba(34, 197, 94, 0.08);
  color: #16A34A;
}

.cancer-indicator.has-cancer {
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626;
}

.cancer-indicator-icon {
  font-size: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.data-table th {
  background: var(--bg-base);
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: bold;
  color: var(--text-primary);
}

.data-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: var(--bg-white);
}

.data-table .clickable-cell {
  color: var(--brand-teal);
  cursor: pointer;
  text-decoration: underline;
}

/* ======================== MONOGENIC DETAIL ======================== */
.monogenic-disease-card {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  position: relative;
  border-left: 3px solid var(--brand-cyan);
}

.monogenic-disease-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-primary);
}

.monogenic-disease-gene {
  font-size: 13px;
  color: var(--text-secondary);
}

.monogenic-disease-class {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.see-more-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--primary-light);
  border: none;
  border-radius: 20px;
  color: var(--brand-teal);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.see-more-btn:hover {
  background: rgba(58, 183, 141, 0.18);
}

/* ======================== OMIC BOX (legacy) ======================== */
.omic-box {
  width: 160px;
  min-width: 160px;
  height: 160px;
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.omic-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.omic-box-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 10px;
}

.omic-box-label {
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  color: var(--text-primary);
}

/* ======================== PATHWAY IMAGE ======================== */
.pathway-card {
  padding: 16px;
  margin-bottom: 24px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
}

.pathway-card-title {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.pathway-card-image {
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 8px;
}

.pathway-card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ======================== EXERCISE ======================== */
.exercise-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.resource-link {
  display: inline-block;
  padding: 6px 12px;
  color: var(--brand-teal);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.resource-link:hover {
  opacity: 0.7;
}

/* ======================== DISCLAIMER ======================== */
.disclaimer {
  font-size: 8px;
  color: var(--text-tertiary);
  text-align: justify;
  margin-top: 20px;
  line-height: 1.4;
}

/* ======================== APOE MODULE ======================== */
.apoe-section {
  padding: 16px;
  margin-bottom: 20px;
  border-radius: var(--card-radius);
  background: var(--bg-white);
  box-shadow: var(--card-shadow);
  border-left: 3px solid #8B5CF6;
}

.apoe-title {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-primary);
}

/* ======================== RESPONSIVE — SMALL MOBILE ======================== */
@media (max-width: 360px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .med-stats-row {
    grid-template-columns: 1fr;
  }
}

/* ======================== RESPONSIVE — TABLET (641px+) ======================== */
@media (min-width: 641px) {
  .list-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .list-card {
    margin: 0;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
  }

  .med-stats-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .info-card {
    padding: 20px;
  }

  .info-card-label {
    font-size: 15px;
  }

  .info-card-description {
    font-size: 15px;
  }

  .data-list-row {
    padding: 16px 20px;
  }

  .data-list-main {
    font-size: 15px;
  }

  .severity-title {
    font-size: 17px;
    padding: 12px 20px;
  }

  .monogenic-disease-card {
    padding: 20px;
  }

  .pathway-card {
    padding: 24px;
  }

  .pathway-card-title {
    font-size: 19px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 18px;
    font-size: 14px;
  }

  .exercise-tabs {
    gap: 8px;
  }

  .nav-btn {
    padding: 10px 20px;
    font-size: 15px;
  }
}

/* ======================== RESPONSIVE — DESKTOP (961px+) ======================== */
@media (min-width: 961px) {
  .list-stack {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .list-card {
    padding: 16px 20px;
    gap: 16px;
  }

  .list-card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .list-card-icon {
    width: 28px;
    height: 28px;
  }

  .list-card-label {
    font-size: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
  }

  .grid-card {
    padding: 22px 18px;
    min-height: 130px;
  }

  .grid-card-label {
    font-size: 15px;
  }

  .info-card {
    padding: 24px;
  }

  .info-card-icon,
  .info-card-icon-tinted {
    width: 36px;
    height: 36px;
  }

  .info-card-label {
    font-size: 16px;
  }

  .info-card-description {
    font-size: 15px;
    line-height: 1.6;
  }

  .data-list-row {
    padding: 16px 24px;
  }

  .factor-card {
    width: 200px;
    min-width: 200px;
    height: 210px;
    padding: 20px;
  }

  .factor-card-label {
    font-size: 15px;
  }

  .food-group-card {
    min-width: 280px;
    width: 300px;
    height: 240px;
    padding: 24px;
  }

  .food-group-name {
    font-size: 20px;
  }

  .modal-content {
    padding: 32px 28px;
  }

  .modal-text {
    font-size: 16px;
  }

  .cancer-indicator {
    padding: 18px 24px;
    font-size: 16px;
  }

  .apoe-section {
    padding: 24px;
  }

  .apoe-title {
    font-size: 19px;
  }

  .monogenic-disease-card {
    padding: 24px;
  }

  .monogenic-disease-name {
    font-size: 16px;
  }

  .severity-section {
    margin-bottom: 24px;
  }

  .severity-title {
    font-size: 18px;
    padding: 14px 24px;
  }
}
