/* File: css/inventory.css */
/* === Inventory Container === */
.inventory-container {
  width: fit-content;
  background: #ffffff;
  padding: 8px;
  font-family: 'Mojangles', monospace, Arial, sans-serif;
  user-select: none;
  margin-top: 24px;
  margin-bottom: 24px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 4px solid #8b8b8b;
  box-shadow:
    inset -4px -4px 0 0 #3a3a3a,
    inset 4px 4px 0 0 #e0e0e0;
  border-radius: 12px;
}

.inventory-container > h4 {
  color: #c6c4c4;
  text-shadow: 1px 2px 1px #000000;
  text-align: center;
  margin-bottom: 12px;
  font-weight: bold;
  font-size: 1.2rem;
}

/* === Top Section (Player + Armor) === */
.inventory-top {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  align-items: center;
}

/* Player Model Wrapper with border and username label inside */
.player-model-wrapper {
  width: 160px;
  height: 220px;
  border: 3px solid #999;
  border-radius: 8px;
  display: flex;
  flex-direction: column;     /* vertical stack username + image */
  justify-content: center;    /* center content vertically */
  align-items: center;        /* center content horizontally */
  user-select: none;
  padding: 8px 0;             /* optional padding for spacing */
  box-sizing: border-box;     /* include border/padding in size */
}

/* Username label above the player model */
.player-username-label {
  background: rgba(0, 0, 0, 0.6); /* faded black */
  color: white;
  font-weight: 600;
  font-size: 1.4rem;
  padding: 2px 8px;
  margin-bottom: 6px;
  user-select: none;
  text-shadow: 1px 1px 3px #000000;
  min-width: 100px;
  text-align: center;
  letter-spacing: 1.5px;
}



/* Armor / Offhand Slots */
.armor-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot {
  width: 37px;
  height: 37px;
  background: transparent;
  border: 2px solid #504f4f;
  border-radius: 6px;
  box-shadow:
    inset 1px 1px 3px #aaa9a9,
    inset -1px -1px 3px #6a6a6a;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 2px 4px;
  cursor: default;
  color: transparent;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 1px 1px 2px #555;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

/* Slot Label */
.slot-label {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #555;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

/* === Tooltip === */
.slot[title] {
  position: relative;
}

.slot[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(60, 60, 60, 0.95);
  color: #f0f0f0;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: pre-line;
  font-size: 11px;
  line-height: 1.2;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  max-width: 220px;
}

/* === Item Count (Bottom Right) === */
.item-count {
  position: absolute;
  bottom: -6px;
  right: 1px;
  font-size: 11px;
  font-weight: normal;
  color: #ffffff;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
  pointer-events: none;
  user-select: none;
}

/* === Item Name (Center Bottom on Hover) === */
.slot .item-type-text {
  display: none;
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #eee;
  text-shadow: 1px 1px 2px #ffffff;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  user-select: none;
}

.slot:hover .item-type-text {
  display: block;
}

/* === Inventory Grids === */
.inventory-grids {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Main Inventory Grid */
.inventory-grid,
.hotbar-grid {
  display: grid;
  grid-template-columns: repeat(9, 40px);
  gap: 2px;
  justify-content: center;
}

.inventory-separator {
  width: 100%;
  height: 1px;
  background-color: #999;
  margin: 6px 0;
  opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 520px) {
  .inventory-container {
    width: 100%;
    padding: 12px;
  }

  .player-model-container {
    width: 120px;
    height: 160px;
  }

  .slot {
    width: 40px;
    height: 40px;
  }

  .inventory-grid,
  .hotbar-grid {
    grid-template-columns: repeat(9, 40px);
    gap: 3px;
  }
}
