/* ================================================================
   Parent-Mode additions for the SJ Formula Hub calculator
   Loaded after styles.css. Uses the same CSS custom properties
   defined in styles.css (--text-dark, --text-mid, etc.).
   ================================================================ */

/* --- Audience toggle (Parent vs Clinician) -------------------- */
.audience-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f4f6f8;
  border: 1px solid #e0e4e8;
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 14px;
}

.audience-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mid, #556);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.2;
}

.audience-btn .sub {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-light, #889);
  margin-top: 2px;
}

.audience-btn:hover {
  background: #fff;
  color: var(--text-dark, #223);
}

.audience-btn.active {
  background: #fff;
  color: #1a56db;
  border-color: #c7d7f6;
  box-shadow: 0 1px 3px rgba(20, 50, 100, 0.08);
}

.audience-btn.active .sub {
  color: #3b6ad8;
}

/* --- Parent banner (above recipe tables) ---------------------- */
.parent-banner {
  background: #eef6ff;
  border: 1px solid #c7dcf5;
  border-left: 4px solid #3b6ad8;
  color: #20345a;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 14px;
}

.parent-banner.warn {
  background: #fff8e6;
  border-color: #f3dca6;
  border-left-color: #d69020;
  color: #5a4220;
}

/* --- Recipe-card table --------------------------------------- */
.parent-recipe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  overflow: hidden;
}

.parent-recipe-table thead th {
  background: #f7f9fc;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-mid, #556);
  border-bottom: 1px solid #e3e6ea;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.parent-recipe-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #eef1f4;
  vertical-align: top;
  color: var(--text-dark, #223);
}

.parent-recipe-table tbody tr:last-child td {
  border-bottom: none;
}

.parent-recipe-table tbody tr:hover {
  background: #fafcff;
}

.parent-recipe-table .sub {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-light, #889);
  margin-top: 2px;
}

/* --- Cal/oz badge -------------------------------------------- */
.cal-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.cal-badge.ok {
  background: #e4f5ea;
  color: #1d6c3c;
}

.cal-badge.close {
  background: #fdf1d8;
  color: #8a5a0a;
}

/* --- Tip paragraph under table ------------------------------ */
.parent-tip {
  font-size: 0.82rem;
  color: var(--text-mid, #556);
  line-height: 1.55;
  background: #f7f9fc;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 4px;
}

.parent-tip strong {
  color: var(--text-dark, #223);
}

/* --- Print-friendly adjustments ------------------------------ */
@media print {
  .audience-toggle,
  .mode-toggle,
  .target-presets,
  .form-group,
  .print-btn {
    display: none !important;
  }
  .parent-recipe-table {
    border: 1px solid #888;
  }
  .parent-recipe-table tbody tr:hover {
    background: #fff;
  }
}

/* --- Mobile tweaks ------------------------------------------ */
@media (max-width: 540px) {
  .audience-toggle {
    grid-template-columns: 1fr;
  }
  .parent-recipe-table thead th,
  .parent-recipe-table tbody td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}
