/* Every top-level block on this page (intro, tabs, roster layout, depot)
   shares this same max-width/padding/centering so their left and right
   edges line up as you scroll. */
#plannerIntro {
  max-width: 900px;
  margin: 16px auto 20px;
  padding: 0 16px;
  color: var(--light-text-color, #999);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

#plannerTabs {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 0 16px;
  display: flex;
  gap: 8px;
}

.plannerTab {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #aaa;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  cursor: pointer;
}

.plannerTab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
}

.plannerTab.active {
  background: rgba(248, 213, 17, 0.12);
  border-color: rgba(248, 213, 17, 0.4);
  color: #f8d511;
  font-weight: bold;
}

.tabPanel {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

.tabPanel.hidden {
  display: none;
}

/* Left-aligned (not independently centered) so its edge matches the
   roster cards/depot rows below it. Kept compact (small gap/margin,
   tight input padding) so the roster/depot content starts higher on the
   page. */
#operatorAdd,
#depotAdd {
  max-width: 480px;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#operatorAdd label,
#depotAdd label {
  font-size: 0.75rem;
  color: #aaa;
}

/* Marks an operator/material not yet released on the EN server (shown
   using CN data instead -- see the cnOnly merge in planner.js's
   loadData()). Distinct from the LMD/rarity yellow used elsewhere so it
   reads as "different source", not "cost/value". */
.cnBadge {
  flex: 0 0 auto;
  background: rgba(255, 159, 67, 0.15);
  color: #ff9f43;
  border: 1px solid rgba(255, 159, 67, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.62rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: help;
}

.rosterEmpty {
  text-align: center;
  color: #777;
  padding: 24px 16px;
  font-size: 0.9rem;
}

.rosterEmpty.hidden {
  display: none;
}

/* Shown after arriving via a calendar "Add to planner" link (see
   applyAddFromLink() in js/planner.js) -- a quick confirmation that the
   operator(s) landed in the roster, since the tab switch alone could
   otherwise look like an unexplained jump. */
.planLinkStatus {
  font-size: 0.85rem;
  color: #f8d511;
  background: rgba(248, 213, 17, 0.1);
  border: 1px solid rgba(248, 213, 17, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin: -4px 0 12px;
}

.planLinkStatus.hidden {
  display: none;
}

/* Two-column layout: the "Add operator" search bar + operator cards on
   the left, the list-style "what you still need" summary on the right --
   always both present (even with an empty roster, so there's somewhere
   to add the first operator), which keeps "Total needed" level with
   "Add operator". Stacks
   on narrow screens (see the media query at the bottom). */
#rosterLayout {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

#rosterLeftCol {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#rosterCards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.operatorCard {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.operatorCard:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.operatorCardIcon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

/* One line: name + optional CN badge. The current/target summary is the
   card's hover tooltip (see formatCardTooltip() in planner.js). */
.operatorCardInfo {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.operatorCardName {
  font-weight: bold;
  font-size: 0.92rem;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operatorCardRemove {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: #999;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
}

.operatorCardRemove:hover {
  color: #e55;
}

/* Small "view operator page" link, shared look between a roster card and
   a search-result row (see .operatorSearchResultDetails below) -- just a
   circled-i glyph so it doesn't compete with the card's own name/remove
   button for attention. */
.operatorCardDetails,
.operatorSearchResultDetails {
  flex: 0 0 auto;
  color: #999;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 4px 4px;
}

.operatorCardDetails:hover,
.operatorSearchResultDetails:hover {
  color: #6fb3ff;
}

#plannerSummary {
  flex: 1 1 380px;
  min-width: 0;
}

#plannerSummary.hidden {
  display: none;
}

.plannerSectionHeading {
  font-size: 1.1rem;
  margin: 0 0 12px;
  color: #eee;
}

#summaryTotals {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.summaryTotal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px 16px;
}

.summaryTotalLabel {
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
}

.summaryTotalValue {
  font-size: 1.3rem;
  font-weight: bold;
  color: #f8d511;
}

.summaryTotalOwned {
  font-size: 0.72rem;
  color: #999;
}

.summaryTotalOwned.hidden {
  display: none;
}

/* The "what you still need" list -- one row per material, so it reads
   as a list next to the operator cards rather than a cloud of tags. */
#summaryMaterials {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summaryMaterialRow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 6px 12px 6px 6px;
}

.summaryMaterialIcon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

/* Set on any icon <img> (operator avatar or material icon) once both the
   primary and fallback asset sources have failed to load -- keeps the
   circular background placeholder visible instead of a broken-image
   glyph. See setIconWithFallback() in planner.js. */
.iconMissing {
  visibility: hidden;
}

.summaryMaterialNameWrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.summaryMaterialName {
  font-size: 0.85rem;
  color: #eee;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summaryMaterialCount {
  font-size: 0.85rem;
  color: #f8d511;
  font-weight: bold;
  flex: 0 0 auto;
}

.summaryMaterialOwned {
  font-size: 0.72rem;
  color: #999;
  flex: 0 0 auto;
}

/* Group headings inside #summaryMaterials (Chips / Skill Summaries /
   Module Items / Farming Materials, plus the per-rarity sub-headings
   inside Farming Materials). Both sit in the same flex column as the
   rows they label, so their own top margin is what separates one
   group from the row above it -- reset on the very first heading so
   the list doesn't start with a stray gap under "Total needed". */
.summaryCategoryHeading {
  font-size: 0.72rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin: 10px 0 0;
}

.summaryRarityHeading {
  font-size: 0.68rem;
  color: #f8d511;
  opacity: 0.8;
  margin: 6px 0 0 2px;
}

#summaryMaterials > .summaryCategoryHeading:first-child {
  margin-top: 0;
}

#depotIntro {
  color: var(--light-text-color, #999);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 14px;
  max-width: 640px;
}

#depotList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.depotRow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
}

.depotRowIcon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.depotRowNameWrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.depotRowName {
  font-size: 0.88rem;
  color: #eee;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Text (not number) input so large LMD/EXP totals show with thousands
   separators instead of being squeezed behind a native spinner -- see
   buildDepotRow() in planner.js, which swaps in plain digits while the
   field is focused so editing isn't fighting commas. */
.depotRowCount {
  width: 6.5em;
  flex: 0 0 auto;
  background: #1c1c1c;
  color: #f8d511;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  text-align: right;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.depotRowCount:focus {
  color: #eee;
  font-weight: normal;
  border-color: #f8d511;
  outline: none;
}

#depotList > .summaryCategoryHeading:first-child {
  margin-top: 0;
}

.depotRowRemove {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: #999;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}

.depotRowRemove:hover {
  color: #e55;
}

.summaryCoveredNote {
  color: var(--light-text-color, #999);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.summaryCoveredNote.hidden {
  display: none;
}

/* The edit modal itself (current/target phase, level, skill level,
   mastery, modules) is styled by css/operator-edit-modal.css, shared
   with every page that opens it -- see js/operator-edit-modal.js. */

/* Matches calendar's #pageCredit treatment exactly. */
#pageCredit {
  max-width: 900px;
  margin: 16px auto 24px;
  padding: 0 16px;
  font-size: 0.75rem;
  color: #999;
  text-align: center;
}

#pageCredit a {
  color: #bbb;
}

#pageCredit a:hover {
  color: #ccc;
}

@media (max-width: 760px) {
  #rosterLayout {
    flex-direction: column;
  }
  #rosterLeftCol {
    flex-basis: auto;
    width: 100%;
  }
  #plannerSummary {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .plannerTab {
    flex: 1 1 0;
    text-align: center;
  }
}
