/* comms.css — Phase 50 comms HUD styles (slim).
 *
 * Per-section styling for the left column's COMMS accordion.
 * Shares the accordion framework with missions.css via
 * column-accordions.css (read that first if touching accordion
 * behavior).
 *
 * This file owns ONLY:
 *   - .apex-comms-section + body / head chrome
 *   - .apex-comms__list / .apex-comms__empty
 *   - .apex-comm row chrome (header, sender, sol pill, body, mark-read)
 *   - .apex-comms-toast (incoming-transmission notification toast) */

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

.apex-comms-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-comms-section[data-expanded="true"] {
  flex: 1 1 0;
  min-height: 0;
}

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

.apex-comms-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-comms-section__head:hover {
  background: rgba(28, 38, 52, 0.7);
}
.apex-comms__label {
  font-weight: 600;
  color: rgba(220, 235, 250, 0.95);
  flex: 1 1 auto;
  text-align: left;
}
.apex-comms__badge {
  background: rgba(245, 176, 86, 0.22);
  border: 1px solid rgba(245, 176, 86, 0.6);
  color: #f8d59c;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.apex-comms__chev {
  opacity: 0.6;
  font-size: 11px;
  width: 12px;
  text-align: center;
}

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

.apex-comms-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-comms-section[data-expanded="true"] .apex-comms-section__body {
  display: block;
}
.apex-comms-section__body::-webkit-scrollbar         { width: 6px; }
.apex-comms-section__body::-webkit-scrollbar-track   { background: transparent; }
.apex-comms-section__body::-webkit-scrollbar-thumb   { background: rgba(120, 150, 175, 0.4); border-radius: 3px; }
.apex-comms-section__body::-webkit-scrollbar-thumb:hover { background: rgba(120, 150, 175, 0.65); }

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

/* ── Comm row ──────────────────────────────────────────────────── */

.apex-comm {
  background: rgba(22, 30, 42, 0.65);
  border-left: 2px solid rgba(120, 150, 175, 0.5);
  border-radius: 2px;
}
.apex-comm[data-kind="mission_control"] { border-left-color: rgba(112, 191, 255, 0.85); }
.apex-comm[data-kind="corp"]            { border-left-color: rgba(245, 176, 86, 0.85); }
.apex-comm[data-kind="faction"]         { border-left-color: rgba(220, 124, 220, 0.85); }
.apex-comm[data-kind="alien"]           { border-left-color: rgba(140, 230, 170, 0.85); }
.apex-comm[data-kind="npc"]             { border-left-color: rgba(77, 208, 197, 0.85); }
.apex-comm[data-unread="true"]          { background: rgba(40, 52, 70, 0.78); }

.apex-comm__header {
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}
.apex-comm__header:hover { background: rgba(255, 255, 255, 0.04); }

.apex-comm__sender {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.apex-comm__kind {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(120, 150, 175, 0.9);
}
.apex-comm__kind--mission_control { color: #b9d8f5; }
.apex-comm__kind--corp            { color: #f8d59c; }
.apex-comm__kind--faction         { color: #e9b9e9; }
.apex-comm__kind--alien           { color: #b6ecc7; }
.apex-comm__kind--npc             { color: #a4ecdf; }
.apex-comm__from {
  font-size: 12px;
  font-weight: 600;
  color: #e6f7f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apex-comm[data-unread="true"] .apex-comm__from::before {
  content: "•";
  margin-right: 5px;
  color: #f8d59c;
}
.apex-comm__sol {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(164, 236, 223, 0.85);
  flex: 0 0 auto;
}
.apex-comm__chev {
  opacity: 0.55;
  font-size: 10px;
}

.apex-comm__preview {
  padding: 0 12px 8px 14px;
  font-size: 11px;
  color: rgba(216, 226, 238, 0.78);
  font-style: italic;
  line-height: 1.4;
}
.apex-comm__body {
  padding: 4px 12px 10px 14px;
  border-top: 1px solid rgba(120, 150, 175, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.apex-comm__text {
  font-size: 12px;
  line-height: 1.5;
  color: #d8e2ee;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.apex-comm__read {
  align-self: flex-start;
  background: rgba(245, 176, 86, 0.2);
  border: 1px solid rgba(245, 176, 86, 0.55);
  color: #f8d59c;
  padding: 3px 9px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.apex-comm__read:hover { background: rgba(245, 176, 86, 0.32); }

/* ── Incoming-transmission toast ───────────────────────────────── */

.apex-comms-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 18px;
  background: rgba(15, 17, 23, 0.95);
  border: 1px solid rgba(245, 176, 86, 0.7);
  border-radius: 4px;
  color: #e6f7f5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 320ms ease-out, transform 320ms ease-out;
  pointer-events: none;
  max-width: 420px;
}
.apex-comms-toast--on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.apex-comms-toast__lbl {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  color: rgba(248, 213, 156, 0.95);
}
.apex-comms-toast__sender {
  font-size: 13px;
  font-weight: 600;
}
.apex-comms-toast__snippet {
  font-size: 11px;
  opacity: 0.8;
  font-style: italic;
}
