/* ============================================
   VETUU — Character Panel
   Float-only modal panel (C key toggle).
   Paper doll with 13 equipment slots,
   equipment inventory sidebar, stat summary.
   ============================================ */

/* ============================================
   PANEL CONTAINER
   ============================================ */
#character-panel {
  position: fixed;
  z-index: 60;
  background: var(--bg-panel);
  border: var(--frame-border-width) solid var(--frame-border);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

#character-panel.hidden {
  display: none;
}

/* ============================================
   TABS
   ============================================ */
.char-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.char-tab {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-display);
  transition: color var(--fade-snappy);
}

.char-tab:hover {
  color: var(--text-secondary);
}

.char-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ============================================
   TAB CONTENT
   ============================================ */
.char-tab-content {
  display: none;
  flex: 1;
  min-height: 0;
}

.char-tab-content.active {
  display: flex;
}

.char-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-md);
  font-style: italic;
}

/* ============================================
   CHARACTER TAB — TWO COLUMN LAYOUT
   ============================================ */
.char-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--gui-padding);
  gap: var(--gui-gap);
  overflow-y: auto;
  min-width: 0;
}

.char-right {
  width: 220px;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* ============================================
   CHARACTER IDENTITY
   ============================================ */
.char-identity {
  display: flex;
  align-items: baseline;
  gap: var(--gui-gap);
  padding: 0 var(--gui-padding-sm);
}

.char-name {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  font-weight: 600;
}

.char-level {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-family: var(--font-numbers);
}

.char-subclass {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* ============================================
   PAPER DOLL
   ============================================ */
.paper-doll {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: var(--gui-padding-sm);
}

.equip-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.equip-column-right {
  justify-content: center;
}

.player-silhouette {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  color: var(--text-disabled);
  font-size: 3rem;
  opacity: 0.3;
}

/* ============================================
   EQUIPMENT SLOTS (Paper Doll)
   ============================================ */
.equip-slot {
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--fade-snappy), background var(--fade-snappy);
}

.equip-slot:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.equip-slot.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.equip-slot.equipped {
  border-color: var(--border-default);
}

/* Rarity border colors for equipped items */
.equip-slot.rarity-common    { border-color: var(--color-rarity-common); }
.equip-slot.rarity-uncommon  { border-color: var(--color-rarity-uncommon); }
.equip-slot.rarity-rare      { border-color: var(--color-rarity-rare); }
.equip-slot.rarity-epic      { border-color: var(--color-rarity-epic); }
.equip-slot.rarity-legendary { border-color: var(--color-rarity-legendary); }

.equip-slot-icon {
  font-size: var(--font-size-lg);
  line-height: 1;
  pointer-events: none;
}

.equip-slot-empty {
  font-size: 7px;
  color: var(--text-disabled);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
}

/* ============================================
   STATS SUMMARY
   ============================================ */
.char-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px var(--gui-gap);
  padding: var(--gui-padding-sm) var(--gui-padding);
  border-top: 1px solid var(--border-subtle);
}

.char-stats-title {
  grid-column: 1 / -1;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 2px;
}

.char-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--font-size-xs);
  gap: 4px;
}

.char-stat-label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.char-stat-value {
  font-family: var(--font-numbers);
  color: var(--text-primary);
  white-space: nowrap;
}

.char-stat-bonus {
  font-family: var(--font-numbers);
  font-size: var(--font-size-2xs);
  color: var(--color-success);
  margin-left: 2px;
}

/* ============================================
   INVENTORY SIDEBAR
   ============================================ */
.equip-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--gui-padding);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-dark);
  flex-shrink: 0;
}

.equip-sidebar-title {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.equip-filter-btn {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  cursor: pointer;
  font-family: var(--font-display);
}

.equip-filter-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.equip-filter-btn.active {
  color: var(--accent);
  border-color: var(--accent);
}

.equip-inventory {
  flex: 1;
  overflow-y: auto;
  padding: var(--gui-padding-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.equip-inventory-empty {
  padding: var(--gui-padding);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-style: italic;
  text-align: center;
}

/* ============================================
   ITEM CARDS (Inventory List)
   ============================================ */
.equip-item-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--fade-snappy), background var(--fade-snappy);
}

.equip-item-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.equip-item-card.equipped-card {
  background: var(--accent-hover);
  border-color: var(--accent-dim);
}

.equip-item-card.locked {
  opacity: 0.4;
  cursor: default;
}

/* Rarity-colored item name */
.equip-item-name {
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.3;
}

.equip-item-name.rarity-common    { color: var(--color-rarity-common); }
.equip-item-name.rarity-uncommon  { color: var(--color-rarity-uncommon); }
.equip-item-name.rarity-rare      { color: var(--color-rarity-rare); }
.equip-item-name.rarity-epic      { color: var(--color-rarity-epic); }
.equip-item-name.rarity-legendary { color: var(--color-rarity-legendary); }

.equip-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
}

.equip-item-ilvl {
  font-family: var(--font-numbers);
}

.equip-item-level {
  font-family: var(--font-numbers);
}

.equip-item-level.over-level {
  color: var(--color-danger);
}

/* ============================================
   EQUIPMENT TOOLTIP
   ============================================ */
.equip-tooltip {
  position: fixed;
  z-index: 200;
  min-width: 180px;
  max-width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  padding: 8px 10px;
  font-family: var(--font-display);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fade-snappy);
}

.equip-tooltip.visible {
  opacity: 1;
}

.ett-name {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: 2px;
}

.ett-slot-rarity {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.ett-ilvl {
  font-family: var(--font-numbers);
  color: var(--text-secondary);
  font-size: var(--font-size-2xs);
  margin-bottom: 6px;
}

.ett-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.ett-stats {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
}

.ett-stat {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
}

.ett-stat-value {
  font-family: var(--font-numbers);
}

.ett-weapon-dmg {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
}

.ett-compare {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

.ett-compare-header {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.ett-compare-stat {
  font-size: var(--font-size-xs);
  font-family: var(--font-numbers);
}

.ett-compare-stat.better { color: var(--color-success); }
.ett-compare-stat.worse  { color: var(--color-danger); }
.ett-compare-stat.same   { color: var(--text-muted); }

.ett-trinket-effect {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ett-trinket-name {
  font-size: var(--font-size-xs);
  color: var(--accent);
  font-weight: 600;
}

.ett-trinket-desc {
  font-size: var(--font-size-2xs);
  color: var(--text-secondary);
  line-height: 1.3;
}

.ett-level-req {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.ett-level-req.unmet {
  color: var(--color-danger);
}

.ett-equipped-label {
  font-size: var(--font-size-2xs);
  color: var(--accent);
  margin-top: 2px;
}

/* --- Set Bonus Tooltip Section --- */
.ett-set-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ett-set-name {
  font-size: var(--font-size-xs);
  color: var(--color-set-bonus);
  font-weight: 600;
}

.ett-set-piece-equipped { font-size: var(--font-size-2xs); color: var(--color-success); }
.ett-set-piece-owned    { font-size: var(--font-size-2xs); color: var(--text-muted); }
.ett-set-piece-missing  { font-size: var(--font-size-2xs); color: var(--text-dim); }

.ett-set-piece-mark {
  display: inline-block;
  width: 12px;
  text-align: center;
}

.ett-set-bonus-active {
  font-size: var(--font-size-2xs);
  color: var(--color-success);
  margin-top: 2px;
}

.ett-set-bonus-inactive {
  font-size: var(--font-size-2xs);
  color: var(--text-dim);
  margin-top: 2px;
}

/* --- Set bonus in stats summary --- */
.char-stat-set-bonus {
  font-family: var(--font-numbers);
  font-size: var(--font-size-2xs);
  color: var(--color-set-bonus);
  margin-left: 2px;
}

/* --- Set indicator on paper doll slots --- */
.equip-slot-set-mark {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 7px;
  color: var(--color-set-bonus);
  line-height: 1;
  pointer-events: none;
}

/* --- Set tag in sidebar item cards --- */
.equip-item-set-tag {
  font-size: var(--font-size-2xs);
  color: var(--color-set-bonus);
}

/* ============================================
   WARDROBE TAB
   ============================================ */
.wardrobe-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

.wardrobe-right {
  width: 220px;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.wardrobe-section-header {
  padding: 6px var(--gui-padding);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.wardrobe-slot-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--gui-padding-sm);
}

.wardrobe-slot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color var(--fade-snappy), background var(--fade-snappy);
}

.wardrobe-slot-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

.wardrobe-slot-row.selected {
  border-color: var(--accent);
  background: var(--accent-hover);
}

.wardrobe-slot-icon {
  width: 20px;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.wardrobe-slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.wardrobe-slot-name {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.wardrobe-slot-status {
  font-size: var(--font-size-2xs);
  color: var(--text-disabled);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wardrobe-slot-count {
  font-size: var(--font-size-2xs);
  font-family: var(--font-numbers);
  color: var(--text-muted);
  flex-shrink: 0;
}

.wardrobe-slot-count.complete {
  color: var(--color-success);
}

/* Style picker (right column) */
.wardrobe-style-picker {
  display: flex;
  flex-direction: column;
  padding: var(--gui-padding-sm);
  gap: 4px;
  flex: 1;
  min-height: 0;
}

.wardrobe-style-header {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

.wardrobe-style-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--fade-snappy), background var(--fade-snappy);
}

.wardrobe-style-card:not(.locked) {
  cursor: pointer;
}

.wardrobe-style-card:not(.locked):hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.wardrobe-style-card.locked {
  opacity: 0.4;
}

.wardrobe-style-card.active-transmog {
  border-color: var(--accent);
  background: var(--accent-hover);
}

.wardrobe-style-name {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.wardrobe-style-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
}

.wardrobe-style-status.active {
  color: var(--accent);
}

.wardrobe-style-status.collected {
  color: var(--color-success);
}

.wardrobe-clear-btn {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: var(--font-size-2xs);
  font-family: var(--font-display);
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: color var(--fade-snappy), border-color var(--fade-snappy);
}

.wardrobe-clear-btn:hover {
  color: var(--color-danger);
  border-color: var(--danger-subtle);
}

.wardrobe-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-style: italic;
  padding: var(--gui-padding);
}

/* Equipment drag ghost (matches paper doll slot style) */
.equip-drag-ghost {
  position: fixed;
  z-index: 300;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0.9;
}

.equip-drag-ghost.rarity-common    { border-color: var(--color-rarity-common); }
.equip-drag-ghost.rarity-uncommon  { border-color: var(--color-rarity-uncommon); }
.equip-drag-ghost.rarity-rare      { border-color: var(--color-rarity-rare); }
.equip-drag-ghost.rarity-epic      { border-color: var(--color-rarity-epic); }
.equip-drag-ghost.rarity-legendary { border-color: var(--color-rarity-legendary); }

.equip-drag-ghost-icon {
  font-size: var(--font-size-lg);
  line-height: 1;
  color: var(--text-secondary);
}

/* Drop target highlight on paper doll slots */
.equip-slot.drop-target {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 6px var(--accent-dim);
}

/* Transmog indicator on paper doll */
.equip-slot.has-transmog::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
}

/* ============================================
   LOADOUT SECTION
   ============================================ */
.equip-loadout-section {
  display: flex;
  align-items: center;
  gap: var(--gui-gap-sm);
  padding: 6px var(--gui-padding);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-dark);
  flex-shrink: 0;
}

.equip-loadout-select {
  flex: 1;
  font-size: var(--font-size-2xs);
  font-family: var(--font-display);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 3px 6px;
  cursor: pointer;
}

.equip-loadout-select:hover {
  border-color: var(--border-default);
}

.equip-loadout-btn {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-display);
}

.equip-loadout-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-default);
}

/* ============================================
   UNEQUIP BUTTON
   ============================================ */
.equip-unequip-btn {
  font-size: var(--font-size-2xs);
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  cursor: pointer;
  font-family: var(--font-display);
  align-self: flex-end;
  margin-top: 2px;
}

.equip-unequip-btn:hover {
  color: var(--color-danger);
  border-color: var(--danger-subtle);
}

/* ============================================
   RESIZE HANDLES (same pattern as ability book)
   ============================================ */
#character-panel .resize-handle {
  position: absolute;
  z-index: 5;
}

#character-panel .resize-handle-n  { top: 0;    left: 8px;  right: 8px;  height: 4px; cursor: n-resize; }
#character-panel .resize-handle-s  { bottom: 0; left: 8px;  right: 8px;  height: 4px; cursor: s-resize; }
#character-panel .resize-handle-e  { top: 8px;  bottom: 8px; right: 0;   width: 4px;  cursor: e-resize; }
#character-panel .resize-handle-w  { top: 8px;  bottom: 8px; left: 0;    width: 4px;  cursor: w-resize; }
#character-panel .resize-handle-se { bottom: 0; right: 0;  width: 10px; height: 10px; cursor: se-resize; }
#character-panel .resize-handle-sw { bottom: 0; left: 0;   width: 10px; height: 10px; cursor: sw-resize; }
#character-panel .resize-handle-ne { top: 0;    right: 0;  width: 10px; height: 10px; cursor: ne-resize; }
#character-panel .resize-handle-nw { top: 0;    left: 0;   width: 10px; height: 10px; cursor: nw-resize; }
