/* =========================================================
   OGACIAL — inventory.css
   Full inventory UI: grid slots, crafting, imbuing, bestiary,
   item tooltips, drag & drop visuals
   ========================================================= */

/* ---------- Inventory Screen ---------- */
.inventory-screen {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 40;
  backdrop-filter: blur(3px);
  gap: 8px;
  pointer-events: auto;
}
.inventory-screen.hidden { display: none; }

/* ---------- Main container ---------- */
.inventory-container {
  display: flex;
  gap: 16px;
  background: rgba(14,18,32,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.9);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: visible;
}

/* ---------- Character panel (left) ---------- */
.inv-character-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  flex-shrink: 0;
}
#invCharCanvas {
  image-rendering: pixelated;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.equipment-slots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.equip-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.equip-slot {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  position: relative;
}
.equip-slot:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
}
.equip-slot img { width: 22px; height: 22px; image-rendering: pixelated; opacity: 0.45; }
.equip-slot.filled img { opacity: 1; }
.inv-player-name {
  font-size: 13px;
  font-weight: 600;
  color: #e8ecf4;
  text-align: center;
}

/* ---------- Main inventory pane (right) ---------- */
.inv-main { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* Tabs */
.inv-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 2px;
}
.inv-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
  margin-bottom: -2px;
  font-family: 'DM Sans', sans-serif;
}
.inv-tab:hover { color: rgba(255,255,255,0.75); }
.inv-tab.active {
  color: #e8ecf4;
  border-bottom-color: #5c8fff;
}

/* Tab content */
.inv-tab-content { display: none; }
.inv-tab-content.active { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Inventory Grid ---------- */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(9, 36px);
  gap: 2px;
}

/* Shared slot style */
.inv-slot {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.08s, background 0.08s;
  overflow: visible;
}
.inv-slot:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  z-index: 2;
}
.inv-slot img {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  pointer-events: none;
}
.inv-slot .slot-count {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.9);
  line-height: 1;
  pointer-events: none;
}
.inv-slot.dragging { opacity: 0.4; }
.inv-slot.drag-over {
  border-color: #5c8fff;
  background: rgba(92,143,255,0.12);
}

/* Durability bar inside slot */
.slot-dur-bar {
  position: absolute;
  bottom: 1px;
  left: 1px;
  right: 1px;
  height: 2px;
  background: rgba(0,0,0,0.4);
  border-radius: 1px;
  overflow: hidden;
}
.slot-dur-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.2s, background 0.2s;
}

/* Item rarity borders */
.inv-slot.rarity-common  { border-color: rgba(255,255,255,0.1); }
.inv-slot.rarity-uncommon { border-color: rgba(34,197,94,0.45); }
.inv-slot.rarity-rare    { border-color: rgba(56,189,248,0.5); }
.inv-slot.rarity-epic    { border-color: rgba(168,85,247,0.55); }
.inv-slot.rarity-legendary { border-color: rgba(240,180,41,0.65); box-shadow: 0 0 6px rgba(240,180,41,0.3); }
.inv-slot.rarity-mythic  { border-color: rgba(232,64,64,0.7); box-shadow: 0 0 8px rgba(232,64,64,0.35); }

/* ---------- Crafting ---------- */
.crafting-area {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.crafting-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 2px;
}
.crafting-arrow {
  font-size: 22px;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
}
.crafting-output { display: flex; }
.output-slot {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
}
.output-slot.has-result {
  border-color: rgba(92,143,255,0.5);
  background: rgba(92,143,255,0.08);
  cursor: pointer;
}
.output-slot.has-result:hover { background: rgba(92,143,255,0.16); }

.recipe-browser { flex: 1; }
.recipe-search {
  width: 100%;
  margin-bottom: 8px;
  font-size: 13px;
}
.recipe-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.recipe-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}
.recipe-row:hover { background: rgba(255,255,255,0.07); }
.recipe-row img { width: 20px; height: 20px; image-rendering: pixelated; }
.recipe-row.craftable { color: #e8ecf4; }
.recipe-row.uncraftable { opacity: 0.4; }

/* ---------- Imbuing ---------- */
.imbuing-area {
  display: flex;
  gap: 20px;
  flex-direction: column;
}
.imbue-slots {
  display: flex;
  align-items: center;
  gap: 10px;
}
.imbue-slot {
  width: 46px;
  height: 46px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
}
.imbue-slot:hover {
  border-color: rgba(168,85,247,0.6);
  background: rgba(168,85,247,0.14);
}
.imbue-slot.main-slot { width: 54px; height: 54px; }
.imbue-slot img { width: 28px; height: 28px; image-rendering: pixelated; opacity: 0.45; }
.imbue-slot.filled img { opacity: 1; }

.imbue-options { display: flex; flex-direction: column; gap: 6px; }
.imbue-hint { font-size: 13px; color: rgba(255,255,255,0.35); font-style: italic; }

.imbue-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(168,85,247,0.07);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.12s;
}
.imbue-option:hover {
  background: rgba(168,85,247,0.14);
  border-color: rgba(168,85,247,0.4);
}
.imbue-option-icon { width: 28px; height: 28px; image-rendering: pixelated; }
.imbue-option-info { flex: 1; }
.imbue-option-name { font-size: 13px; font-weight: 600; color: #e8ecf4; }
.imbue-option-desc { font-size: 11px; color: rgba(255,255,255,0.45); }
.imbue-option-cost { font-size: 12px; color: #7cfc00; font-weight: 600; }

/* ---------- Bestiary ---------- */
.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.bestiary-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.1s;
}
.bestiary-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}
.bestiary-card.undiscovered { filter: grayscale(1) brightness(0.4); }
.bestiary-card img { width: 40px; height: 40px; image-rendering: pixelated; }
.bestiary-card .mob-name { font-size: 10px; color: rgba(255,255,255,0.65); margin-top: 4px; }
.bestiary-card .mob-kills { font-size: 10px; color: #5c8fff; }

/* ---------- Hotbar (inventory bottom copy) ---------- */
.inv-hotbar {
  display: flex;
  gap: 2px;
  pointer-events: auto;
}

/* ---------- Item Tooltip ---------- */
.item-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(10,13,20,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 10px 14px;
  min-width: 160px;
  max-width: 280px;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  font-size: 13px;
}
.tooltip-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}
.tooltip-name.common   { color: #e8ecf4; }
.tooltip-name.uncommon { color: #22c55e; }
.tooltip-name.rare     { color: #38bdf8; }
.tooltip-name.epic     { color: #a855f7; }
.tooltip-name.legendary { color: #f0b429; }
.tooltip-name.mythic   { color: #ef4444; }
.tooltip-rarity {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.tooltip-type { color: rgba(255,255,255,0.5); font-size: 12px; margin-bottom: 6px; }
.tooltip-desc { color: rgba(255,255,255,0.65); font-size: 12px; font-style: italic; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 6px; margin-top: 4px; }
.tooltip-stat {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  padding: 1px 0;
}
.tooltip-stat .stat-val.positive { color: #22c55e; }
.tooltip-stat .stat-val.negative { color: #ef4444; }
.tooltip-imbues { margin-top: 6px; border-top: 1px solid rgba(168,85,247,0.2); padding-top: 6px; }
.tooltip-imbue {
  font-size: 11px;
  color: #a855f7;
  padding: 1px 0;
}

/* Dragged item ghost */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  width: 36px;
  height: 36px;
  opacity: 0.85;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
}

/* ---------- Hint text ---------- */
.inv-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-align: center;
}
