/* frontend/css/inventory-drag.css */

/* ===== DRAG & DROP СОСТОЯНИЯ ===== */

/* Слот во время перетаскивания */
.inv-slot.dragging {
  opacity: 0.4;
  border: 2px dashed #4299e1;
  background: rgba(66, 153, 225, 0.1);
  transform: scale(0.95);
  transition: all 0.2s ease;
}

.char-slot.shoulders-slot::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 80px;
  background-image: url('images/armor/sholders.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.3;
  z-index: 0;
}

.char-slot.shoulders-slot .slot {
  position: relative;
  z-index: 1;
}

/* Ghost элемент при перетаскивании */
.drag-ghost {
  cursor: grabbing !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  animation: ghostPulse 0.3s ease-in-out;
  user-select: none;
}

@keyframes ghostPulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Подсветка при наведении во время drag */
.inv-slot.drag-over {
  background: rgba(66, 153, 225, 0.2);
  border: 2px solid #4299e1;
  box-shadow: 0 0 12px rgba(66, 153, 225, 0.4);
  transform: scale(1.05);
  transition: all 0.15s ease;
}

/* ===== КУРСОРЫ ===== */

/* Курсор при наведении на предмет */
.inv-slot.has-item {
  cursor: grab;
}

.inv-slot.has-item:active {
  cursor: grabbing;
}

.inv-slot:not(.has-item) {
  cursor: default;
}

/* ===== АНИМАЦИИ ===== */

/* Анимация swap */
.inv-slot.swapping {
  animation: slotSwap 0.3s ease-in-out;
}

@keyframes slotSwap {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(66, 153, 225, 0.6);
  }
}

/* Анимация появления предмета */
.inv-slot.item-added {
  animation: itemAdded 0.4s ease-out;
}

@keyframes itemAdded {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== ЭЛЕМЕНТЫ ПРЕДМЕТА ===== */

/* Иконка предмета */
.item-icon {
  font-size: 28px;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Количество предметов */
.item-qty {
  position: absolute;
  bottom: 2px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffd700;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===== СЛОТ ИНВЕНТАРЯ ===== */

.inv-slot {
  position: relative;
  width: 66px;
  height: 66px;
  background: var(--slot, #2d3748);
  border: 1px dashed var(--slot-b, #4a5568);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.inv-slot:hover {
  border-color: #718096;
  background: #374151;
}

.inv-slot.has-item {
  border-style: solid;
  border-color: #4a5568;
  background: #1e2536;
}

.inv-slot.has-item:hover {
  border-color: #4299e1;
  box-shadow: 0 0 8px rgba(66, 153, 225, 0.3);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .inv-slot {
    width: 56px;
    height: 56px;
  }
  
  .item-icon {
    font-size: 24px;
  }
  
  .item-qty {
    font-size: 10px;
    padding: 1px 4px;
  }
}