/* ================================
   포켓몬 스킬 시스템 스타일
================================ */

/* 포켓몬 타입 색상 정의 (포켓몬 본가 공식 색상) */
:root {
  --type-normal: #A8A878;
  --type-fire: #F08030;
  --type-water: #6890F0;
  --type-electric: #F8D030;
  --type-grass: #78C850;
  --type-ice: #98D8D8;
  --type-fighting: #C03028;
  --type-poison: #A040A0;
  --type-ground: #E0C068;
  --type-flying: #A890F0;
  --type-psychic: #F85888;
  --type-bug: #A8B820;
  --type-rock: #B8A038;
  --type-ghost: #705898;
  --type-dragon: #7038F8;
  --type-dark: #705848;
  --type-steel: #B8B8D0;
  --type-fairy: #EE99AC;
}

/* 포켓몬 상세정보 - 스킬 섹션 */
.pokemon-detail-moves {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.moves-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.moves-section-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: var(--text-light);
}

/* 포켓몬 상세정보 모달 내부에서 사용되는 경우 - 밝은 배경이므로 어두운 텍스트 */
#pokemon-detail-modal .pokemon-detail-moves {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #2c3e50 !important;
}

#pokemon-detail-modal .pokemon-detail-moves * {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .moves-section-header h3 {
  color: #1a237e !important;
  font-weight: 700;
}

#pokemon-detail-modal .move-slot {
  background: #ffffff;
  border: 2px solid #dee2e6;
  color: #2c3e50 !important;
}

#pokemon-detail-modal .move-slot:hover {
  background: #f0f0f0;
  border-color: var(--pokemon-yellow);
}

#pokemon-detail-modal .move-slot {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .move-slot * {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .move-slot-number {
  color: #6c757d !important;
}

#pokemon-detail-modal .move-slot.empty {
  color: #adb5bd !important;
  background: #f8f9fa !important;
}

#pokemon-detail-modal .move-name {
  color: #1a237e !important;
  font-weight: 700;
}

#pokemon-detail-modal .move-category {
  color: #495057 !important;
}

#pokemon-detail-modal .move-stats {
  color: #6c757d !important;
}

.btn-manage-moves {
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--pokemon-blue), var(--pokemon-red));
  color: #ffffff !important;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

#pokemon-detail-modal .btn-manage-moves,
#detail-manage-moves-btn {
  color: #ffffff !important;
}

#pokemon-detail-modal .btn-manage-moves *,
#detail-manage-moves-btn * {
  color: #ffffff !important;
}

.btn-manage-moves:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 스킬 슬롯 그리드 */
.moves-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

#pokemon-detail-modal .moves-slots {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .moves-slots * {
  color: #2c3e50 !important;
}

.move-slot {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.move-slot:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--pokemon-yellow);
  transform: translateY(-2px);
}

.move-slot.empty {
  border-style: dashed;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: rgba(255, 255, 255, 0.5);
}

.move-slot.empty:hover {
  opacity: 0.8;
}

.move-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.move-slot-number {
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.6);
}

.move-name {
  font-weight: bold;
  font-size: 0.95em;
  color: var(--text-light);
  margin-bottom: 4px;
}

/* 포켓몬 상세정보 모달 내부 스킬 슬롯 텍스트 - 어두운 색상 (이미 위에서 정의됨) */

.move-type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  margin-right: 4px;
}

.move-category {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* 포켓몬 상세정보 모달 내부 */
#pokemon-detail-modal .move-category {
  color: #495057 !important;
}

.move-stats {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

/* 포켓몬 상세정보 모달 내부 */
#pokemon-detail-modal .move-stats {
  color: #6c757d !important;
}

/* 타입별 색상 */
.type-normal { background-color: var(--type-normal); }
.type-fire { background-color: var(--type-fire); }
.type-water { background-color: var(--type-water); }
.type-electric { background-color: var(--type-electric); }
.type-grass { background-color: var(--type-grass); }
.type-ice { background-color: var(--type-ice); }
.type-fighting { background-color: var(--type-fighting); }
.type-poison { background-color: var(--type-poison); }
.type-ground { background-color: var(--type-ground); }
.type-flying { background-color: var(--type-flying); }
.type-psychic { background-color: var(--type-psychic); }
.type-bug { background-color: var(--type-bug); }
.type-rock { background-color: var(--type-rock); }
.type-ghost { background-color: var(--type-ghost); }
.type-dragon { background-color: var(--type-dragon); }
.type-dark { background-color: var(--type-dark); }
.type-steel { background-color: var(--type-steel); }
.type-fairy { background-color: var(--type-fairy); }

/* 스킬 관리 모달 */
#moves-management-modal {
  z-index: 10001 !important;
}

/* 스킬 관리 모달 닫기 버튼 스타일 */
#moves-management-modal .btn-secondary {
  background: #6c757d !important;
  color: #ffffff !important;
  border: 1px solid #5a6268 !important;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 20px;
  width: 100%;
  transition: all 0.3s ease;
}

#moves-management-modal .btn-secondary:hover {
  background: #5a6268 !important;
  border-color: #495057 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.moves-management-content {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff !important;
  color: #2c3e50 !important;
}

.moves-pokemon-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.moves-pokemon-info img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.moves-pokemon-name {
  font-size: 1.2em;
  font-weight: bold;
  color: #1a237e;
}

.moves-pokemon-level {
  font-size: 0.9em;
  color: #6c757d;
}

.moves-management-section {
  margin-bottom: 24px;
}

.moves-management-section h3 {
  color: #1a237e;
  margin-bottom: 12px;
  font-size: 1.1em;
  font-weight: 700;
}

.learnable-moves-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.moves-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.moves-filter select {
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #2c3e50;
  font-size: 0.9em;
  min-width: 120px;
}

@media (max-width: 768px) {
  .learnable-moves-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .moves-filter {
    width: 100%;
    flex-direction: column;
  }
  
  .moves-filter select {
    width: 100%;
  }
}

/* 장착된 기술 목록 */
.equipped-moves {
  display: grid;
  gap: 10px;
}

.equipped-move-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #2c3e50;
}

.equipped-move-item.has-recoil {
  border-left: 3px solid #e74c3c;
}

.equipped-move-info {
  flex: 1;
}

.equipped-move-name {
  font-weight: bold;
  color: #1a237e;
  margin-bottom: 4px;
}

.equipped-move-details {
  font-size: 0.85em;
  color: #6c757d;
}

.equipped-move-actions {
  display: flex;
  gap: 8px;
}

.btn-change-move,
.btn-remove-move {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.3s ease;
}

.btn-change-move {
  background: var(--pokemon-blue);
  color: white;
}

.btn-change-move:hover {
  background: #0c3d7a;
}

.btn-remove-move {
  background: #e74c3c;
  color: white;
}

.btn-remove-move:hover {
  background: #c0392b;
}

/* 배울 수 있는 기술 목록 */
.learnable-moves-list {
  max-height: 400px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.learnable-move-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  transition: all 0.3s ease;
  color: #2c3e50;
}

.learnable-move-item:hover {
  background: #e9ecef;
  border-color: var(--pokemon-yellow);
}

.learnable-move-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.learnable-move-info {
  flex: 1;
}

.learnable-move-item.has-recoil {
  border-left: 3px solid #e74c3c;
}

.recoil-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid #e74c3c;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  cursor: help;
  position: relative;
}

.recoil-badge:hover {
  background: rgba(231, 76, 60, 0.3);
}

.learnable-move-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.learnable-move-name {
  font-weight: bold;
  color: #1a237e;
}

.learnable-move-stats {
  font-size: 0.85em;
  color: #6c757d;
  margin-bottom: 4px;
}

.learnable-move-method {
  font-size: 0.75em;
  color: #6c757d;
}

.learnable-move-method.level-up {
  color: var(--pokemon-yellow);
}

.learnable-move-method.machine {
  color: #6890F0;
}

.learnable-move-method.egg {
  color: #78C850;
}

.learnable-move-method.tutor {
  color: #F85888;
}

.btn-equip-move {
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--pokemon-blue), var(--pokemon-red));
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.3s ease;
}

.btn-equip-move:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-equip-move:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 스킬 교체 선택 모달 (슬롯이 4개 찬 경우) */
.move-replace-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.move-replace-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: #2c3e50;
}

.move-replace-content h3 {
  color: #1a237e;
  margin-bottom: 16px;
  font-weight: 700;
}

.move-replace-content p {
  color: #6c757d;
  margin-bottom: 20px;
}

.move-replace-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.move-replace-slot {
  padding: 12px;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #2c3e50;
}

.move-replace-slot:hover {
  border-color: var(--pokemon-yellow);
  background: #fffbe8;
}

.move-replace-slot.selected {
  border-color: var(--pokemon-red);
  background: #fdedec;
}

.move-replace-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .moves-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .moves-management-content {
    max-width: 95%;
  }

  .learnable-moves-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .equipped-move-item,
  .learnable-move-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .equipped-move-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
