/* crew-panel.css — Phase 48 named NPC crewmate HUD styles.
 *
 * Per-section styling for the left column's CREW accordion. Shares the
 * accordion framework with missions.css + comms.css + log-panel.css via
 * column-accordions.css (read that first if touching accordion
 * behavior).
 *
 * This file owns ONLY:
 *   - .apex-crew-section + body / head chrome
 *   - .apex-crew__list / .apex-crew__empty
 *   - .apex-crew row chrome (name, state chip, role, mood meter)
 */

/* ── Section container ─────────────────────────────────────────── */

.apex-crew-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 8px -10px 0;
  border-top: 1px solid rgba(120, 150, 175, 0.18);
}
.apex-crew-section[data-expanded="true"] {
  flex: 1 1 0;
  min-height: 0;
}

/* ── Header button ─────────────────────────────────────────────── */

.apex-crew-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  box-sizing: border-box;
  padding: 0 10px;
  margin: 0;
  width: 100%;
  background: rgba(20, 28, 40, 0.6);
  border: 0;
  border-bottom: 1px solid rgba(120, 150, 175, 0.25);
  color: rgba(220, 235, 250, 0.85);
  font-size: 12px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
}
.apex-crew-section__head:hover {
  background: rgba(28, 38, 52, 0.7);
}
.apex-crew__label {
  font-weight: 600;
  color: rgba(220, 235, 250, 0.95);
  flex: 1 1 auto;
  text-align: left;
}
.apex-crew__badge {
  background: rgba(180, 220, 245, 0.22);
  border: 1px solid rgba(180, 220, 245, 0.6);
  color: #c4dff5;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.apex-crew__chev {
  opacity: 0.6;
  font-size: 11px;
  width: 12px;
  text-align: center;
}

/* ── Body (scrollable) ─────────────────────────────────────────── */

.apex-crew-section__body {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 10px 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 150, 175, 0.45) transparent;
}
.apex-crew-section[data-expanded="true"] .apex-crew-section__body {
  display: block;
}
.apex-crew-section__body::-webkit-scrollbar         { width: 6px; }
.apex-crew-section__body::-webkit-scrollbar-track   { background: transparent; }
.apex-crew-section__body::-webkit-scrollbar-thumb   { background: rgba(120, 150, 175, 0.4); border-radius: 3px; }
.apex-crew-section__body::-webkit-scrollbar-thumb:hover { background: rgba(120, 150, 175, 0.65); }

.apex-crew__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.apex-crew__empty {
  opacity: 0.55;
  font-style: italic;
  font-size: 12px;
  padding: 6px 2px;
  color: #d8e2ee;
}

/* ── Crew row ─────────────────────────────────────────────────── */

.apex-crew {
  background: rgba(22, 30, 42, 0.65);
  border-left: 2px solid rgba(120, 150, 175, 0.5);
  border-radius: 2px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.apex-crew[data-state="missing"]        { border-left-color: rgba(190, 120, 120, 0.85); opacity: 0.85; }
.apex-crew[data-state="active"]         { border-left-color: rgba(140, 230, 170, 0.85); }
.apex-crew[data-state="writing"]        { border-left-color: rgba(245, 220, 130, 0.85); }
.apex-crew[data-state="heir_apparent"]  { border-left-color: rgba(196, 158, 230, 0.95); }
.apex-crew[data-state="joined"]         { border-left-color: rgba(112, 191, 255, 0.95); }
.apex-crew[data-state="contacted"]      { border-left-color: rgba(245, 176, 86, 0.85); }
.apex-crew[data-role="captain"]         { border-left-color: rgba(180, 220, 245, 0.95); }

.apex-crew__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.apex-crew__name {
  font-size: 13px;
  font-weight: 600;
  color: #e6f7f5;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apex-crew__state-chip {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 9px;
  background: rgba(120, 150, 175, 0.18);
  color: rgba(220, 235, 250, 0.85);
  border: 1px solid rgba(120, 150, 175, 0.35);
  flex: 0 0 auto;
}
.apex-crew__state-chip--missing       { background: rgba(190, 120, 120, 0.18); border-color: rgba(190, 120, 120, 0.5); color: #f0c8c8; }
.apex-crew__state-chip--active        { background: rgba(140, 230, 170, 0.16); border-color: rgba(140, 230, 170, 0.45); color: #b6ecc7; }
.apex-crew__state-chip--writing       { background: rgba(245, 220, 130, 0.16); border-color: rgba(245, 220, 130, 0.45); color: #f5e69c; }
.apex-crew__state-chip--heir_apparent { background: rgba(196, 158, 230, 0.18); border-color: rgba(196, 158, 230, 0.5); color: #d6bcec; }
.apex-crew__state-chip--joined        { background: rgba(112, 191, 255, 0.18); border-color: rgba(112, 191, 255, 0.5); color: #b9d8f5; }
.apex-crew__state-chip--contacted     { background: rgba(245, 176, 86, 0.18);  border-color: rgba(245, 176, 86, 0.5);  color: #f8d59c; }

.apex-crew__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.apex-crew__role {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(164, 236, 223, 0.85);
  flex: 0 0 auto;
}

/* ── Mood meter ────────────────────────────────────────────────── */

.apex-crew__mood {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.apex-crew__mood-track {
  position: relative;
  width: 64px;
  height: 6px;
  background: rgba(120, 150, 175, 0.18);
  border: 1px solid rgba(120, 150, 175, 0.25);
  border-radius: 3px;
  overflow: hidden;
}
.apex-crew__mood-zero {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(220, 235, 250, 0.4);
}
.apex-crew__mood-fill {
  position: absolute;
  top: 0;
  height: 100%;
  max-width: 50%;
}
.apex-crew__mood-fill--neg {
  right: 50%;
  background: linear-gradient(to left, rgba(190, 120, 120, 0.85), rgba(220, 90, 90, 0.95));
}
.apex-crew__mood-fill--pos {
  left: 50%;
  background: linear-gradient(to right, rgba(140, 230, 170, 0.85), rgba(110, 220, 150, 0.95));
}
.apex-crew__mood-val {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(220, 235, 250, 0.8);
  min-width: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
