/* Базовий контейнер з обмеженням висоти */
.inv-adaptive-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  height: calc(100vh - 140px);
  font-family: "Orbitron", sans-serif;
  color: #e0e6ed;
  overflow: hidden;
}

/* Header */
.inv-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1a2638;
  padding-bottom: 10px;
  margin-bottom: 5px;
}

.inv-logo {
  font-size: 1.1rem;
  color: #00d4ff;
  letter-spacing: 3px;
  margin: 0;
}
.inv-stats-bar {
  font-size: 11px;
  color: #4a5d75;
}
.text-cyan {
  color: #00d4ff;
  font-weight: bold;
}

/* Layout Wrapper */
.inv-layout-wrapper {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* Спільні стилі панелей */
.inv-panel {
  background: rgba(10, 15, 24, 0.85);
  border: 1px solid #1a2638;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.panel-label {
  background: #1a2638;
  color: #00d4ff;
  font-size: 10px;
  padding: 5px 12px;
  letter-spacing: 2px;
  font-weight: 800;
  border-bottom: 1px solid #1a2638;
}

/* Loadout (L) */
.loadout {
  width: 240px;
  flex-shrink: 0;
}
.equip-list-compact {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equip-row-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(26, 38, 56, 0.8);
  transition: 0.2s;
  cursor: pointer;
}

.equip-row-mini:hover {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.05);
}
.slot-name-tiny {
  font-size: 9px;
  color: #4a5d75;
}

.equip-box-mini {
  width: 36px;
  height: 36px;
  background: #000;
  border: 1px solid #1a2638;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d4ff;
  font-size: 1.1rem;
}

/* Cargo (R) */
.cargo {
  flex: 1;
}
.cargo-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  grid-auto-rows: 65px;
  gap: 10px;
  padding: 15px;
  overflow-y: auto;
}

.item-slot {
  background: rgba(5, 8, 12, 0.9);
  border: 1px solid #1a2638;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}

.item-slot:hover {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.1);
}
.item-slot.active {
  border-color: #00d4ff;
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Rarity Colors */
.item-slot.rare,
.equip-box-mini.rare {
  border-bottom: 2px solid #00d4ff;
}
.item-slot.epic,
.equip-box-mini.epic {
  border-bottom: 2px solid #a335ee;
}
.item-slot.legendary,
.equip-box-mini.legendary {
  border-bottom: 2px solid #ffaa00;
}

.qty-label {
  position: absolute;
  bottom: 2px;
  right: 5px;
  font-size: 10px;
  color: #00d4ff;
  font-family: monospace;
}
.item-slot.empty {
  opacity: 0.15;
  cursor: default;
}

/* Modal Styles */
.inv-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.inv-modal-box {
  background: #0a0f18;
  border: 1px solid #1a2638;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.modal-header-scan {
  padding: 20px;
  border-bottom: 1px solid #1a2638;
  position: relative;
}

.modal-header-scan.rare {
  border-left: 5px solid #00d4ff;
}
.modal-header-scan.legendary {
  border-left: 5px solid #ffaa00;
}

.rarity-text {
  font-size: 10px;
  color: #4a5d75;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.modal-header-scan h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
}

.close-x {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #4a5d75;
  font-size: 24px;
  cursor: pointer;
}

.modal-body-scan {
  padding: 20px;
}
.description-text {
  font-size: 12px;
  color: #8a9cb3;
  line-height: 1.5;
  margin-bottom: 20px;
}

.stats-scanner {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  margin-bottom: 20px;
}
.stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-line .value {
  color: #00ff88;
}

.modal-equip-btn {
  width: 100%;
  letter-spacing: 2px;
  font-weight: 900;
}

/* Адаптивність під мобільні пристрої */
@media (max-width: 768px) {
  .inv-layout-wrapper {
    flex-direction: column;
    overflow-y: auto;
  }

  .loadout {
    width: 100%;
    flex: 0 0 auto;
  }

  .equip-list-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cargo {
    min-height: 450px;
    flex: 0 0 auto;
  }

  .inv-adaptive-container {
    height: 100%;
    overflow-y: auto;
    padding: 10px;
  }
}

.cargo-grid-v2 {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(60px, 1fr)
  ); /* Кожен слот мінімум 60px */
  gap: 8px;
  padding: 10px;
}

.item-slot {
  width: 60px; /* Жорсткий розмір слота */
  height: 60px; /* Жорсткий розмір слота */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  overflow: hidden; /* Обрізаємо все, що виходить за межі 60x60 */
}
