/* ======================================================
   UI STYLE — ui.css
   Inventario, Hotbar, Stats, Crafting, Shops
====================================================== */

/* INVENTARIO */
#inventoryPanel {
  position:fixed;
  left:50%;
  top:12%;
  transform:translateX(-50%);
  width:900px;
  max-height:85vh;
  overflow:auto;
  border-radius:12px;
  background: var(--panel-bg);
  padding:12px;
  display:none;
  z-index:1000;
  box-shadow: var(--shadow);
}

#inventoryPanel.open { display:block; }

.inventory-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.inventory-header button {
  border:none;
  background: rgba(255,255,255,0.08);
  color:var(--text);
  border-radius:6px;
  padding:6px 10px;
  cursor:pointer;
}

.inventory-layout {
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:12px;
  max-height:calc(80vh - 60px);
  overflow:auto;
}

.inv-left {
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.05);
  border-radius:10px;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:calc(80vh - 80px);
  overflow:auto;
}
.inv-avatar {
  display:flex;
  align-items:center;
  gap:10px;
}
.inv-avatar-img {
  width:72px;
  height:72px;
  background: linear-gradient(135deg, rgba(125,211,252,0.2), rgba(255,255,255,0.05));
  border-radius:10px;
}
.inv-avatar-name {
  font-weight:700;
  font-size:14px;
}

.inv-equip-grid {
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:8px;
}
.equip-slot {
  background: rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:8px;
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.equip-label {
  font-size:12px;
  opacity:0.8;
}
.equip-box {
  height:64px;
  border:1px dashed rgba(255,255,255,0.12);
  border-radius:6px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.equip-box img {
  width:100%;
  height:100%;
  object-fit:contain;
}
.equip-placeholder {
  color:rgba(255,255,255,0.4);
  font-size:18px;
}

.inv-stats {
  display:flex;
  flex-direction:column;
  gap:4px;
  background: rgba(255,255,255,0.03);
  border-radius:8px;
  padding:8px;
  border:1px solid rgba(255,255,255,0.05);
}
.stat-row {
  display:flex;
  justify-content:space-between;
  font-size:12px;
}

.inv-right {
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.05);
  border-radius:10px;
  padding:10px;
  max-height:calc(80vh - 80px);
  overflow:auto;
  display:block;
}

#inventoryGrid,
.inv-grid {
  display:grid !important;
  grid-template-columns: repeat(8, minmax(60px, 1fr));
  gap:10px;
  align-items:stretch;
  width:100%;
  box-sizing:border-box;
}

.inventory-slot {
  width:100%;
  padding-top:100%; /* fuerza cuadrado */
  border-radius:8px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.inventory-slot.selected {
  outline:2px solid var(--accent);
}
.inventory-slot.empty {
  background:rgba(255,255,255,0.02);
  border:1px dashed rgba(255,255,255,0.1);
}
.inventory-slot.empty::after {
  content:"+";
  color:rgba(255,255,255,0.35);
  font-size:18px;
}
.inventory-slot .content {
  position:absolute;
  inset:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.inv-item-img {
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.inv-item-name {
  font-size:11px;
  text-align:center;
  padding:2px 4px;
  color:rgba(255,255,255,0.85);
}

.inv-drag-ghost {
  box-shadow:0 8px 18px rgba(0,0,0,0.45);
}

/* HOTBAR */
.hotbar-container {
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  gap:8px;
  z-index:1000;
}

.hotbar-slot {
  width:48px;
  height:48px;
  background:rgba(255,255,255,0.05);
  border:2px solid rgba(255,255,255,0.08);
  border-radius:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.hotbar-slot.active {
  border-color:var(--accent);
  box-shadow:0 0 12px rgba(125,211,252,0.5);
}

.hotbar-slot img {
  width:34px;
  height:34px;
  object-fit:contain;
}

/* STATS HUD (hp/sp/xp barras) */
.stats-bar {
  position:fixed;
  left:20px;
  bottom:90px;
  pointer-events:none;
  z-index:900;
}

/* SHOP PANEL */
#shopPanel {
  position:fixed;
  left:50%;
  top:12%;
  transform:translateX(-50%);
  width:640px;
  max-height:70vh;
  overflow:auto;
  background:var(--panel-bg);
  padding:12px;
  border-radius:10px;
  display:none;
  z-index:1100;
  box-shadow:var(--shadow);
}

#shopPanel img {
  width:48px;
  height:48px;
  object-fit:contain;
}

/* CRAFTING PANEL */
#craftingPanel {
  position:fixed;
  right:20px;
  top:80px;
  width:300px;
  max-height:70vh;
  overflow:auto;
  background:var(--panel-bg);
  padding:10px;
  border-radius:10px;
  display:none;
  box-shadow:var(--shadow);
  z-index:1100;
}

.craft-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:6px 4px;
  background:rgba(255,255,255,0.02);
  border-radius:6px;
  margin-bottom:6px;
}

/* EFFECTS (proyectiles y AOE) */
.effect-projectile {
  position:absolute;
  width:12px;
  height:12px;
  background: radial-gradient(circle, #fff, #ff7a00);
  border-radius:50%;
  pointer-events:none;
}

.effect-aoe {
  position:absolute;
  border-radius:50%;
  background: radial-gradient(circle, rgba(255,100,60,0.3), rgba(255,100,50,0.1));
  border:1px solid rgba(255,100,60,0.4);
  pointer-events:none;
}
