/**
 * 人物模型和装备槽样式 - Game UI Style
 */

.character-section {
  background: 
    linear-gradient(135deg, rgba(21, 27, 38, 0.85) 0%, rgba(10, 14, 20, 0.9) 100%);
  border: 2px solid rgba(255, 61, 0, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 40px rgba(255, 61, 0, 0.1);
  position: relative;
  backdrop-filter: blur(20px) saturate(180%);
  overflow: hidden;
}

/* Glass reflection effect */
.character-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 100%
  );
  pointer-events: none;
}

/* Top accent line */
.character-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--color-primary) 50%, 
    transparent 100%
  );
  opacity: 0.8;
}

.character-view {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: var(--spacing-md);
  min-height: 450px;
}

.character-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.character-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: radial-gradient(circle, rgba(255, 61, 0, 0.08) 0%, transparent 70%);
  padding: var(--spacing-lg);
  filter: drop-shadow(0 0 30px rgba(255, 61, 0, 0.2));
}

.equipment-slot {
  position: absolute;
  width: 70px;
  height: 70px;
  border: 2px solid rgba(42, 52, 65, 0.6);
  border-radius: var(--radius-sm);
  background: 
    linear-gradient(135deg, rgba(21, 27, 38, 0.95) 0%, rgba(10, 14, 20, 0.98) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  /* transform is set via JS: translate(-50%, -50%) */
}

/* Inner highlight for depth */
.equipment-slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    transparent 100%
  );
  pointer-events: none;
}

/* Corner accent */
.equipment-slot::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-top: 2px solid rgba(255, 61, 0, 0.3);
  border-left: 2px solid rgba(255, 61, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.equipment-slot:hover::after {
  opacity: 1;
}

.equipment-slot:hover {
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(255, 61, 0, 0.4),
    0 0 30px rgba(255, 61, 0, 0.3);
  border-color: var(--color-primary);
  z-index: 10;
}

.equipment-slot.required {
  border-color: var(--color-warning);
  border-width: 3px;
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(255, 214, 0, 0.4);
  animation: requiredPulse 2.5s ease-in-out infinite;
}

/* 装备后的必须槽位不再显示黄色边框 */
.equipment-slot.required.filled {
  animation: none;
}

.equipment-slot.required::after {
  border-color: var(--color-warning);
  opacity: 0.6;
}

@keyframes requiredPulse {
  0%, 100% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.05),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 25px rgba(255, 214, 0, 0.4);
  }
  50% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.05),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 40px rgba(255, 214, 0, 0.6);
  }
}

.equipment-slot.optional {
  border-color: rgba(0, 229, 255, 0.3);
  border-style: dashed;
  border-width: 2px;
  background: 
    linear-gradient(135deg, rgba(21, 27, 38, 0.7) 0%, rgba(10, 14, 20, 0.8) 100%);
}

/* 装备后的可选槽位改为实线边框 */
.equipment-slot.optional.filled {
  border-style: solid;
}

.equipment-slot.optional::after {
  border-color: var(--color-secondary);
}

.equipment-slot.empty {
  opacity: 0.7;
}

.equipment-slot.empty:hover {
  opacity: 1;
}

.equipment-slot.filled {
  background: 
    linear-gradient(135deg, rgba(0, 255, 65, 0.12) 0%, rgba(21, 27, 38, 0.95) 100%);
  border-color: var(--color-success);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(0, 255, 65, 0.3);
}

.equipment-slot.filled::after {
  border-color: var(--color-success);
  opacity: 0.8;
}

.slot-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-top: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  font-family: var(--font-mono);
  opacity: 0.9;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
  position: relative;
  z-index: 2;
}

/* 装备后的标签样式 */
.equipment-slot.filled .slot-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(255, 255, 255, 0.3);
  opacity: 1;
  letter-spacing: 0.5px;
}

.slot-placeholder {
  width: 40px;
  height: 40px;
  opacity: 0.15;
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: grayscale(1);
  transition: all var(--transition-normal);
  position: relative;
  z-index: 0;
}

/* 装备后隐藏占位符 */
.equipment-slot.filled .slot-placeholder {
  display: none !important;
}

/* Grid pattern for empty slots */
.slot-placeholder::before {
  content: '';
  position: absolute;
  inset: 8px;
  background-image: 
    linear-gradient(rgba(255, 61, 0, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 61, 0, 0.1) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.3;
}

.equipment-slot.empty .slot-placeholder {
  opacity: 0.25;
  display: flex;
}

.equipment-slot.empty:hover .slot-placeholder {
  opacity: 0.5;
  filter: grayscale(0);
  transform: scale(1.1);
}

.equipment-slot.required .slot-placeholder::before {
  background-image: 
    linear-gradient(rgba(255, 214, 0, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 214, 0, 0.15) 1px, transparent 1px);
}

.equipment-slot.optional .slot-placeholder::before {
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.1) 1px, transparent 1px);
}

.slot-equipment-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
  transition: all var(--transition-normal);
  position: relative;
  z-index: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  padding: 2px;
}

.equipment-slot:hover .slot-equipment-icon {
  filter: drop-shadow(0 4px 16px rgba(255, 61, 0, 0.7));
  transform: scale(1.08);
}

/* 稀有度图标发光效果 */
.equipment-slot.rarity-common .slot-equipment-icon {
  filter: drop-shadow(0 2px 8px rgba(117, 117, 117, 0.6));
}

.equipment-slot.rarity-rare .slot-equipment-icon {
  filter: drop-shadow(0 2px 8px rgba(33, 150, 243, 0.7));
}

.equipment-slot.rarity-epic .slot-equipment-icon {
  filter: drop-shadow(0 2px 8px rgba(156, 39, 176, 0.8));
}

.equipment-slot.rarity-legendary .slot-equipment-icon {
  filter: drop-shadow(0 2px 8px rgba(255, 152, 0, 0.9));
  animation: iconGlow 1.5s ease-in-out infinite;
}

@keyframes iconGlow {
  0%, 100% {
    filter: drop-shadow(0 2px 8px rgba(255, 152, 0, 0.9));
  }
  50% {
    filter: drop-shadow(0 4px 16px rgba(255, 152, 0, 1));
  }
}

.slot-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #D32F00 100%);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  box-shadow: 
    0 2px 8px rgba(255, 61, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(10, 14, 20, 0.9);
  animation: countPulse 1.2s ease-in-out infinite;
}

@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Slot positions are set dynamically via JavaScript from config */
/* DO NOT hard-code positions here - they come from master-config.json */


/* ========== 槽位选中状态 ========== */
.equipment-slot.slot-selected {
  border-color: var(--color-secondary) !important;
  box-shadow: 
    0 0 20px rgba(0, 229, 255, 0.6),
    0 0 40px rgba(0, 229, 255, 0.3),
    inset 0 0 15px rgba(0, 229, 255, 0.2) !important;
  animation: slotSelectedPulse 1s ease-in-out infinite;
}

@keyframes slotSelectedPulse {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(0, 229, 255, 0.6),
      0 0 40px rgba(0, 229, 255, 0.3),
      inset 0 0 15px rgba(0, 229, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(0, 229, 255, 0.8),
      0 0 60px rgba(0, 229, 255, 0.5),
      inset 0 0 20px rgba(0, 229, 255, 0.3);
  }
}

/* ========== 装备稀有度边框颜色和光晕 ========== */
.equipment-slot.filled.rarity-common {
  border-color: #757575 !important;
  border-width: 3px;
  background: 
    linear-gradient(135deg, rgba(117, 117, 117, 0.15) 0%, rgba(21, 27, 38, 0.95) 100%);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(117, 117, 117, 0.5),
    0 0 40px rgba(117, 117, 117, 0.3) !important;
  animation: commonGlow 3s ease-in-out infinite;
}

@keyframes commonGlow {
  0%, 100% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 20px rgba(117, 117, 117, 0.5),
      0 0 40px rgba(117, 117, 117, 0.3);
  }
  50% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 25px rgba(117, 117, 117, 0.6),
      0 0 50px rgba(117, 117, 117, 0.4);
  }
}

.equipment-slot.filled.rarity-rare {
  border-color: #2196F3 !important;
  border-width: 3px;
  background: 
    linear-gradient(135deg, rgba(33, 150, 243, 0.18) 0%, rgba(21, 27, 38, 0.95) 100%);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(33, 150, 243, 0.6),
    0 0 50px rgba(33, 150, 243, 0.4) !important;
  animation: rareGlow 2.5s ease-in-out infinite;
}

@keyframes rareGlow {
  0%, 100% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 25px rgba(33, 150, 243, 0.6),
      0 0 50px rgba(33, 150, 243, 0.4);
  }
  50% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 35px rgba(33, 150, 243, 0.8),
      0 0 70px rgba(33, 150, 243, 0.5);
  }
}

.equipment-slot.filled.rarity-epic {
  border-color: #9C27B0 !important;
  border-width: 3px;
  background: 
    linear-gradient(135deg, rgba(156, 39, 176, 0.2) 0%, rgba(21, 27, 38, 0.95) 100%);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(156, 39, 176, 0.7),
    0 0 60px rgba(156, 39, 176, 0.5) !important;
  animation: epicGlow 2s ease-in-out infinite;
}

@keyframes epicGlow {
  0%, 100% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 30px rgba(156, 39, 176, 0.7),
      0 0 60px rgba(156, 39, 176, 0.5);
  }
  50% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 40px rgba(156, 39, 176, 0.9),
      0 0 80px rgba(156, 39, 176, 0.6);
  }
}

.equipment-slot.filled.rarity-legendary {
  border-color: #FF9800 !important;
  border-width: 3px;
  background: 
    linear-gradient(135deg, rgba(255, 152, 0, 0.25) 0%, rgba(21, 27, 38, 0.95) 100%);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(255, 152, 0, 0.8),
    0 0 70px rgba(255, 152, 0, 0.6),
    0 0 100px rgba(255, 152, 0, 0.4) !important;
  animation: legendaryGlow 1.5s ease-in-out infinite;
}

@keyframes legendaryGlow {
  0%, 100% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 35px rgba(255, 152, 0, 0.8),
      0 0 70px rgba(255, 152, 0, 0.6),
      0 0 100px rgba(255, 152, 0, 0.4);
  }
  50% {
    box-shadow: 
      inset 0 2px 8px rgba(0, 0, 0, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 45px rgba(255, 152, 0, 1),
      0 0 90px rgba(255, 152, 0, 0.8),
      0 0 130px rgba(255, 152, 0, 0.5);
  }
}

/* 稀有度边框的角落装饰 */
.equipment-slot.filled.rarity-common::after {
  border-color: #757575 !important;
  opacity: 0.8;
}

.equipment-slot.filled.rarity-rare::after {
  border-color: #2196F3 !important;
  opacity: 0.9;
}

.equipment-slot.filled.rarity-epic::after {
  border-color: #9C27B0 !important;
  opacity: 1;
}

.equipment-slot.filled.rarity-legendary::after {
  border-color: #FF9800 !important;
  opacity: 1;
  animation: legendaryCorner 1.5s ease-in-out infinite;
}

@keyframes legendaryCorner {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 152, 0, 0.8));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 152, 0, 1));
  }
}
