/*
 * Copyright (C) 2026 Yzapre
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

/* ── Completionist page ──────────────────────────────── */
.comp-wrap {
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Station cards ───────────────────────────────────── */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.station-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.station-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.station-card-header h3 {
  font-size: 1.02rem;
  margin-bottom: 0.15rem;
}

.station-level-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}

.station-level {
  font-size: 0.82rem;
  color: var(--muted);
}

.station-level.maxed {
  color: #8eff8e;
  font-weight: 600;
}

.edit-level-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  font-family: inherit;
}
.edit-level-btn:hover { background: var(--border); color: var(--text); }

/* ── Level-set popover ───────────────────────────────── */
.level-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  width: 190px;
}
.level-popover.open { display: block; }
.level-popover p {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
  line-height: 1.35;
}
.level-popover-row {
  display: flex;
  gap: 0.4rem;
}
.level-popover input[type="number"] {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  font-family: inherit;
  font-size: 0.85rem;
}
.level-popover button {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  font-family: inherit;
  white-space: nowrap;
}
.level-popover button:hover { background: var(--border); }

/* ── Requirements list ───────────────────────────────── */
.req-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.4em
}
.req-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.req-list::-webkit-scrollbar { width: 5px; }
.req-list::-webkit-scrollbar-track { background: transparent; }
.req-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.req-item {
  position: relative;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.req-item .req-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  opacity: 0.55;
  transition: width 0.15s;
}
.req-item .req-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
}
.req-item .req-icon-box {
  width: 24px; height: 24px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.req-item .req-icon {
  width: auto; height: auto;
  max-width: 24px; max-height: 24px;
  image-rendering: pixelated;
}
.req-item .req-name { font-weight: 600; }
.req-item .req-qty {
  color: var(--text);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.req-item.req-short .req-qty { color: #ff9999; font-weight: 600; }
.req-empty {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Card action buttons ─────────────────────────────── */
.station-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.station-card-actions button {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
}
.station-card-actions button:hover:not(:disabled) { background: var(--border); }
.station-card-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Tabs (page-specific look, kept as-is) ───────────── */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tab-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--border); color: var(--text); }
.tab-btn.active {
  background: var(--border);
  color: var(--text);
  font-weight: 600;
  border-color: var(--muted);
}
.tab-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 0.1rem;
}

.section-panel { display: none; }
.section-panel.active { display: block; }
.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}
.section-title-bar strong { font-size: 0.9rem; }

#comp-sections-container .ore-table { min-width: 700px; }

.td-remaining { color: #ff9999; font-weight: 600; }
.td-remainder { color: #8eff8e; }

/* ── Small toolbar (Compact View toggle) ─────────────── */
.comp-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 500px) {
  .comp-wrap { text-align: left; }
}
