/* ═══════════════════════════════════════════════════════════════════
   src/skills-panel.css
   SKILLS-PANEL-01 (#2916) — K-panel Skills / Action Book
   ═══════════════════════════════════════════════════════════════════ */

/* ── Panel shell ──────────────────────────────────────────────────── */

#skills-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 900;
  width: 700px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: #0e0e16;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  font-family: inherit;
  color: #d0d0e0;
  font-size: 13px;
  user-select: none;
}

/* ── Header: tabs + close ─────────────────────────────────────────── */

.sp-header {
  display: flex;
  align-items: center;
  padding: 8px 10px 0;
  border-bottom: 1px solid #1e1e2e;
  background: #0b0b13;
  border-radius: 6px 6px 0 0;
  gap: 6px;
  flex-shrink: 0;
}

.sp-tab {
  padding: 5px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  background: transparent;
  color: #888;
  font-size: 12px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.sp-tab:hover:not(.sp-tab--locked) {
  color: #ccc;
  background: #15151f;
}

.sp-tab--active {
  border-color: #2a2a3a;
  background: #0e0e16;
  color: #b0c4ff;
  position: relative;
  bottom: -1px;
}

.sp-tab--locked {
  cursor: default;
  opacity: 0.45;
}

.sp-tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a7eff;
  margin-right: 5px;
  vertical-align: middle;
}

.sp-lock-icon {
  margin-right: 4px;
  opacity: 0.6;
}

.sp-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 3px;
}

.sp-close:hover { color: #ccc; background: #1e1e2e; }

/* ── Body: skill grid + detail ───────────────────────────────────── */

.sp-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left: skill node grid ───────────────────────────────────────── */

.sp-grid {
  flex: 1;
  min-width: 0;
  padding: 22px 16px;
  overflow-y: auto;
  border-right: 1px solid #1e1e2e;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  gap: 22px 8px;
  align-content: start;
  justify-items: center;
}

.sp-grid .sp-empty-tree { grid-column: 1 / -1; }

.sp-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 88px;
  padding: 2px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.sp-node--locked { cursor: default; }

.sp-node--placeholder {
  cursor: default;
  pointer-events: none;
}

.sp-node-iconwrap {
  position: relative;
  width: 54px;
  height: 54px;
}

.sp-node-icon,
.sp-node-icon-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #14141f;
  border: 2px solid #2c2c3e;
  box-sizing: border-box;
  object-fit: cover;
  transition: border-color 0.15s, box-shadow 0.15s, filter 0.15s;
}

.sp-node-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sp-node:hover:not(.sp-node--locked) .sp-node-icon,
.sp-node:hover:not(.sp-node--locked) .sp-node-icon-placeholder {
  border-color: #4a6aff;
  box-shadow: 0 0 9px rgba(74, 106, 255, 0.4);
}

.sp-node--selected .sp-node-icon,
.sp-node--selected .sp-node-icon-placeholder {
  border-color: #5a7aff !important;
  box-shadow: 0 0 11px rgba(90, 122, 255, 0.6) !important;
}

.sp-node--locked .sp-node-icon,
.sp-node--locked .sp-node-icon-placeholder {
  filter: grayscale(0.85) brightness(0.5);
  border-color: #242430;
}

.sp-node--maxed .sp-node-icon,
.sp-node--maxed .sp-node-icon-placeholder {
  border-color: #d4af37;
  box-shadow: 0 0 9px rgba(212, 175, 55, 0.45);
}

.sp-node--preview .sp-node-icon,
.sp-node--preview .sp-node-icon-placeholder {
  border-color: #3ad6a0;
}

.sp-node--learned .sp-node-icon,
.sp-node--learned .sp-node-icon-placeholder {
  border-color: #4a90d0;
}

.sp-node--unlockable .sp-node-icon,
.sp-node--unlockable .sp-node-icon-placeholder {
  border-color: #3a5a7a;
}

.sp-node-ph-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px dashed #24243a;
  box-sizing: border-box;
}

.sp-node-rank {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 24px;
  padding: 1px 6px;
  border-radius: 9px;
  background: #11111c;
  border: 1px solid #2c2c3e;
  font-size: 10px;
  font-weight: 700;
  color: #aab;
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;
  z-index: 2;
}

.sp-node--maxed .sp-node-rank   { color: #ffd700; border-color: #5a4a10; }
.sp-node--preview .sp-node-rank { color: #6affbe; border-color: #1a4a30; }
.sp-node--learned .sp-node-rank { color: #90c0ff; border-color: #243a4a; }

.sp-node-name {
  font-size: 11px;
  color: #c0c0d0;
  text-align: center;
  line-height: 1.25;
  max-width: 88px;
}

.sp-node--locked .sp-node-name {
  color: #5a5a66;
}

.sp-node-lock {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #999;
  z-index: 2;
}

/* ── Right: skill detail ─────────────────────────────────────────── */

.sp-detail {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
  min-height: 0;
}

.sp-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #444;
  font-size: 12px;
}

.sp-detail-name {
  font-size: 16px;
  font-weight: 600;
  color: #d0d8ff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-detail-rank {
  font-size: 13px;
  font-weight: 400;
  color: #888;
}

.sp-detail-rank--maxed { color: #ffd700; }
.sp-detail-rank--preview { color: #6affbe; }
.sp-detail-rank--learned { color: #90c0ff; }

.sp-detail-divider {
  height: 1px;
  background: #1e1e2e;
  margin: 8px 0;
}

.sp-detail-desc {
  color: #aaa;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.sp-detail-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}

.sp-detail-meta span {
  margin-right: 12px;
}

.sp-detail-locked-notice {
  background: #1a1010;
  border: 1px solid #3a2020;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
  color: #c06060;
  margin-bottom: 8px;
}

.sp-detail-preview-notice {
  background: #0d1a10;
  border: 1px solid #1a3a20;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
  color: #60c080;
  margin-bottom: 8px;
}

.sp-assign-btn {
  display: inline-block;
  padding: 5px 12px;
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  border-radius: 3px;
  color: #7acc7a;
  font-size: 11px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.sp-assign-btn:hover {
  background: #1e361e;
  border-color: #3a6a3a;
}

.sp-alloc-btn {
  display: inline-block;
  padding: 5px 12px;
  background: #1a1a2e;
  border: 1px solid #2a2a5e;
  border-radius: 3px;
  color: #7a90ff;
  font-size: 11px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.sp-alloc-btn:hover:not(:disabled) {
  background: #1e1e3e;
  border-color: #4a4a8e;
}

.sp-alloc-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Footer: SP + Reset + Apply ──────────────────────────────────── */

.sp-footer {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #1e1e2e;
  background: #0b0b13;
  border-radius: 0 0 6px 6px;
  gap: 8px;
  flex-shrink: 0;
}

.sp-sp-info {
  flex: 1;
  font-size: 11px;
  color: #888;
}

.sp-sp-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a7eff;
  margin-right: 5px;
  vertical-align: middle;
}

.sp-sp-count {
  color: #b0c4ff;
  font-weight: 600;
}

.sp-btn {
  padding: 5px 13px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.sp-btn--reset {
  background: #1a1a26;
  border: 1px solid #2a2a3a;
  color: #888;
}

.sp-btn--reset:hover:not(:disabled) {
  background: #1e1e30;
  color: #aaa;
}

.sp-btn--apply {
  background: #1a2a4a;
  border: 1px solid #2a4a8a;
  color: #7ab0ff;
  font-weight: 600;
}

.sp-btn--apply:hover:not(:disabled) {
  background: #1e2e54;
  border-color: #3a5a9a;
}

.sp-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.sp-apply-status {
  font-size: 11px;
  padding: 0 6px;
}

.sp-apply-status--ok   { color: #60c080; }
.sp-apply-status--err  { color: #c06060; }
.sp-apply-status--busy { color: #aaa; }

/* ── CLASS-CHANGE-UI-01 (#2990) ──────────────────────────────────── */

/* ── Tabs header: dynamic tabs container ─────────────────────────── */

.sp-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1;
}

/* ── SP footer: tree-complete label ─────────────────────────────── */

.sp-sp-treecomp {
  color: #ffd700;
  font-weight: 600;
}

/* ── Skill node: post-change state badges ───────────────────────── */

.sp-node--carried .sp-node-icon,
.sp-node--carried .sp-node-icon-placeholder {
  border-color: #2a6a4a !important;
}

.sp-node--inactive {
  opacity: 0.45;
}

.sp-node--inactive .sp-node-name {
  color: #666;
}

.sp-node-cf-badge {
  position: absolute;
  bottom: -4px;
  right: 2px;
  font-size: 10px;
  color: #6affbe;
  font-weight: 700;
  z-index: 2;
}

/* ── Detail pane: carry-forward / inactive notices ──────────────── */

.sp-detail-cf-notice {
  background: #0d1a10;
  border: 1px solid #1a4a28;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
  color: #6affbe;
  margin-bottom: 6px;
}

.sp-detail-inactive-notice {
  background: #1a1010;
  border: 1px solid #3a2020;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

/* ── Empty Vanguard tree placeholder ────────────────────────────── */

.sp-empty-tree {
  padding: 16px 10px;
  color: #555;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* ── Class change section (below .sp-body, above .sp-footer) ────── */

.sp-cc-section {
  border-top: 1px solid #1e1e2e;
  padding: 10px 12px;
  background: #0b0b13;
}

.sp-cc-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-cc-heading {
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sp-cc-subtitle {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 4px;
}

.sp-cc-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sp-cc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: #111122;
  border: 1px solid #2a3a5a;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 110px;
  color: inherit;
  font-family: inherit;
}

.sp-cc-card:hover:not(.sp-cc-card--locked) {
  border-color: #4a6aff;
  background: #0d0d28;
}

.sp-cc-card--locked {
  cursor: default;
  opacity: 0.4;
}

.sp-cc-card-icon {
  font-size: 20px;
  line-height: 1;
}

.sp-cc-card-name {
  font-size: 12px;
  font-weight: 600;
  color: #c0d0ff;
}

.sp-cc-card--locked .sp-cc-card-name {
  color: #666;
}

.sp-cc-card-desc {
  font-size: 10px;
  color: #666;
  text-align: center;
  line-height: 1.4;
}

/* ── Class change confirmation modal ────────────────────────────── */

.sp-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-cc-modal-box {
  background: #0e0e16;
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85);
  padding: 20px 22px;
  max-width: 440px;
  width: 100%;
  font-size: 13px;
  color: #d0d0e0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-cc-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #d0d8ff;
  margin: 0;
  padding: 0;
}

.sp-cc-modal-warning {
  background: #1a1000;
  border: 1px solid #5a3a00;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
  color: #ffd060;
}

.sp-cc-modal-body {
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
  margin: 0;
}

.sp-cc-modal-cf-section {
  background: #0b0b13;
  border: 1px solid #1e1e2e;
  border-radius: 4px;
  padding: 8px 10px;
}

.sp-cc-modal-cf-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.sp-cc-modal-cf-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-cc-modal-cf-item {
  font-size: 11px;
  color: #6affbe;
}

.sp-cc-modal-error {
  background: #1a0a0a;
  border: 1px solid #5a2020;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
  color: #ff8080;
}

.sp-cc-modal-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.sp-cc-btn-cancel {
  background: #1a1a26;
  border: 1px solid #2a2a3a;
  color: #888;
}

.sp-cc-btn-cancel:hover {
  background: #1e1e30;
  color: #aaa;
}

.sp-cc-btn-confirm {
  background: #1a1a3a;
  border: 1px solid #4a4aaa;
  color: #a0b0ff;
  font-weight: 700;
}

.sp-cc-btn-confirm:hover:not(:disabled) {
  background: #22226a;
  border-color: #6a6aff;
  color: #c0d0ff;
}

.sp-cc-btn-confirm:disabled {
  opacity: 0.4;
  cursor: default;
}
