/* ============================================================================
   course-components.css  —  Shared component look-and-feel for all HSCI modules
   ----------------------------------------------------------------------------
   Single source of truth for the repeated UI components across HSCI 130, 230,
   341, 410 and 841. Linked LAST in every module (immediately before </body>)
   so that, at equal specificity, these rules win over any drifted inline CSS.

   All rules reference the shared :root palette already defined in every module
   (--teal, --green, --dark-teal, --grey, --very-light-teal, --light-green,
    --radius, --shadow, --shadow-lg, --text, --text-light, --accent, etc.),
   so nothing here hard-codes a theme colour except the deliberately faint
   greys used as neutral surfaces.

   Canonical references:
     • Learning-objectives box  → HSCI 130 L1 S1  (.info-box.green)
     • Flash-card popup         → HSCI 230 L1 S2  (.flip-card / .card-modal*)
     • Tabbed content           → HSCI 341 L1 S2  (.tabs) + faint grey surface
   ============================================================================ */


/* ── 1. Learning-objectives box & info boxes ─────────────────────────────────
   The green variant is the standard "Learning Objectives" container shown after
   the Introduction and Overview block on every section. */
.info-box        { border-radius: var(--radius); padding: 24px; margin: 24px 0; border-left: 4px solid var(--teal); }
.info-box.teal   { background: var(--very-light-teal); border-color: var(--teal); }
.info-box.green  { background: var(--light-green);     border-color: var(--green); }
.info-box.rose   { background: var(--light-rose);      border-color: var(--accent); }
.info-box.amber  { background: #FFF8E1;                border-color: #FFA000; }
.info-box h4         { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--dark-teal); }
.info-box.green h4   { color: var(--green); }
.info-box .box-title { font-weight: 700; margin-bottom: 6px; color: inherit; }
.info-box ul     { margin: 0 0 0 22px; padding: 0; }
.info-box li     { margin-bottom: 5px; }


/* ── 2. Flash cards (popup style) ────────────────────────────────────────────
   Face = title + hint on a teal gradient tile; click opens a centred modal. */
.flip-grid,
.flip-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin: 24px 0;
}
.flip-card {
  cursor: pointer; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(135deg, rgba(11,123,107,0.9), rgba(6,92,80,0.95)), url('../bg_texture.jpg') center/cover no-repeat;
  color: #fff; padding: 24px 18px; text-align: center; min-height: 100px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.flip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* Standard face markup is <span class="card-title"> + <span class="card-hint">.
   .card-label / .card-icon are legacy faces kept here as a visual safety net:
   the label is styled like a title and the "+" icon is hidden, so any face that
   was not converted still matches the standard look. */
.flip-card .card-title,
.flip-card .card-label { font-weight: 600; font-size: 15px; line-height: 1.4; color: #fff; }
.flip-card .card-hint  { position: absolute; bottom: 8px; left: 0; right: 0; font-size: 11px; opacity: 0.6; }
.flip-card .card-icon  { display: none; }

/* Modal */
.card-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
.card-modal-overlay.show { display: flex; }
.card-modal {
  background: #fff; border-radius: 16px; max-width: 520px; width: 100%;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: fadeIn 0.3s ease;
  max-height: 80vh; display: flex; flex-direction: column;
}
.card-modal-header {
  background: linear-gradient(135deg, rgba(11,123,107,0.92), rgba(6,92,80,0.95)), url('../bg_texture.jpg') center/cover no-repeat;
  color: #fff; padding: 24px 28px; position: relative;
}
.card-modal-header h3 { font-size: 18px; font-weight: 700; margin: 0; color: #fff; }
.card-modal-close {
  position: absolute; top: 12px; right: 16px; background: rgba(255,255,255,0.2);
  border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.card-modal-close:hover { background: rgba(255,255,255,0.35); }
.card-modal-body { padding: 24px 28px; font-size: 15px; line-height: 1.7; color: var(--text); overflow-y: auto; }


/* ── 3. Tabbed content (bordered, faint grey surface) ────────────────────────
   341 L1 tab styling, set on a very faint light-grey surface as requested. */
.tabs {
  margin: 24px 0;
  background: #F6F7F8;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  padding: 8px 8px 0;
}
.tab-buttons {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 2px solid var(--grey);
  padding-bottom: 0; margin-bottom: 0;
}
.tab-btn {
  padding: 10px 18px; border: none; background: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--text-light);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s;
  border-radius: 8px 8px 0 0;
}
.tab-btn:hover { background: var(--very-light-teal); color: var(--dark-teal); }
.tab-btn.active { color: var(--dark-teal); border-bottom-color: var(--accent); font-weight: 600; background: var(--very-light-teal); }
.tab-panel {
  display: none; padding: 24px;
  background: #FCFCFD;
  border: 1px solid var(--grey); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 15px; line-height: 1.7;
}
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }


/* ── 4. Other shared components (standardized for consistency) ───────────────
   Accordion, data tables and glossary entries had drifted between courses;
   these pin them to one look. Reflection boxes, R-boxes and quizzes carry
   interactive state styling and are intentionally left to each module. */

/* Accordion */
.accordion { margin: 24px 0; }
.accordion-item { border: 1px solid var(--grey); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; background: var(--white); }
.accordion-header {
  padding: 16px 20px; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; font-weight: 600; font-size: 15px;
  transition: background 0.2s; user-select: none;
}
.accordion-header:hover { background: var(--very-light-teal); }
.accordion-header .arrow { transition: transform 0.3s; font-size: 12px; color: var(--accent); }
.accordion-item.open .accordion-header { background: var(--very-light-teal); color: var(--dark-teal); }
.accordion-item.open .accordion-header .arrow { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.accordion-body-inner { padding: 0 20px 20px; font-size: 15px; line-height: 1.7; color: var(--text-light); }

/* Data tables */
.data-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 14px; }
.data-table th { background: var(--dark-teal); color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--grey); }
.data-table tr:nth-child(even) { background: var(--very-light-teal); }
.data-table .highlight { background: var(--light-amber); font-weight: 600; }

/* Glossary entries */
.glossary-entry {
  background: var(--white);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px; margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-left-color 0.15s;
}
.glossary-entry:hover { transform: translateX(2px); }
.glossary-entry.glossary-person  { border-left-color: var(--accent); }
.glossary-entry.glossary-concept { border-left-color: var(--teal); }
.glossary-entry.glossary-method  { border-left-color: var(--purple); }
.glossary-entry .glossary-term {
  display: block; font-weight: 700; color: var(--dark-teal);
  font-size: 15.5px; margin-bottom: 4px;
}
.glossary-entry.glossary-person .glossary-term { color: var(--accent-dark); }
.glossary-entry .glossary-def { font-size: 14.5px; color: var(--text); line-height: 1.6; }
.glossary-entry.hidden { display: none; }
