/* ================================
   모달 스타일
   모달 기본 스타일, 리워드 모달, 확인 모달 등
================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
}

.modal-content h2 {
  font-size: 24px;
  color: var(--pokemon-blue);
  margin-bottom: 24px;
}

#reward-modal .modal-content {
  background: #ffffff !important;
  color: #2c3e50 !important;
}

#reward-modal .modal-content h2 {
  color: #1a237e !important;
  font-weight: 700;
}

.reward-summary {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.reward-icon {
  font-size: 24px;
}

.reward-pokemon-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.reward-pokemon {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.reward-pokemon.shiny {
  background: linear-gradient(135deg, #fff9c4, #fff59d);
  border: 2px solid #ffd700;
}

.reward-pokemon.rarity-common {
  background: #ffffff;
}

.reward-pokemon.rarity-uncommon {
  background: linear-gradient(135deg, #f1f8e9, #81c784);
  border-color: rgba(34, 197, 94, 0.6);
}

.reward-pokemon.rarity-rare {
  background: linear-gradient(135deg, #e3f2fd, #64b5f6);
  border-color: rgba(59, 130, 246, 0.6);
}

.reward-pokemon.rarity-epic {
  background: linear-gradient(135deg, #f3e5f5, #ba68c8);
  border-color: rgba(168, 85, 247, 0.6);
}

.reward-pokemon.rarity-legendary {
  background: linear-gradient(135deg, #fff8e1, #ffb74d);
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 4px 10px rgba(255, 183, 77, 0.3);
}

.reward-pokemon.rarity-mythical {
  background: linear-gradient(135deg, #fce4ec, #f06292);
  border-color: rgba(236, 72, 153, 0.6);
  box-shadow: 0 4px 10px rgba(240, 98, 146, 0.3);
}

.reward-pokemon .shiny-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #8b6914;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid #ffd700;
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.5);
  z-index: 10;
}

.reward-pokemon img {
  width: 50px;
  height: 50px;
  image-rendering: pixelated;
  object-fit: contain;
  margin-bottom: 4px;
}

.reward-pokemon .name {
  font-size: 11px;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.reward-pokemon.rarity-legendary .name {
  color: rgba(133, 88, 0, 1) !important;
}

.reward-pokemon.rarity-mythical .name {
  color: rgba(136, 14, 79, 1) !important;
}

.reward-pokemon.rarity-epic .name {
  color: rgba(74, 20, 140, 1) !important;
}

.reward-pokemon.rarity-rare .name {
  color: rgba(13, 71, 161, 1) !important;
}

.reward-pokemon.rarity-uncommon .name {
  color: rgba(27, 94, 32, 1) !important;
}

.reward-pokemon .level {
  font-size: 10px;
  color: rgba(44, 62, 80, 0.7);
  margin-top: 2px;
}

.reward-pokemon.rarity-legendary .level {
  color: rgba(133, 88, 0, 0.8) !important;
}

.reward-pokemon.rarity-mythical .level {
  color: rgba(136, 14, 79, 0.8) !important;
}

.reward-pokemon.rarity-epic .level {
  color: rgba(74, 20, 140, 0.8) !important;
}

.reward-pokemon.rarity-rare .level {
  color: rgba(13, 71, 161, 0.8) !important;
}

.reward-pokemon.rarity-uncommon .level {
  color: rgba(27, 94, 32, 0.8) !important;
}

.reward-pokemon .pokemon-card-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reward-pokemon .star-rank {
  font-size: 11px;
  letter-spacing: -2px;
}

.reward-pokemon .grade-badge {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.reward-pokemon .grade-badge.grade-S {
  background: linear-gradient(135deg, #ff4081, #f50057);
}

.reward-pokemon .grade-badge.grade-A {
  background: linear-gradient(135deg, #7c4dff, #651fff);
}

.reward-pokemon .grade-badge.grade-B {
  background: linear-gradient(135deg, #2196f3, #2979ff);
}

.reward-pokemon .grade-badge.grade-C {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

.reward-items-obtained {
  margin-top: 24px;
  margin-bottom: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.items-obtained-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 16px;
  text-align: center;
}

.items-obtained-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.item-obtained-card {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border-radius: 12px;
  padding: 12px 16px;
  border: 2px solid #ff9800;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
  min-width: 150px;
}

.item-obtained-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.item-obtained-icon {
  font-size: 24px;
  line-height: 1;
}

.item-obtained-name {
  font-weight: 600;
  color: #e65100;
  flex: 1;
}

.item-obtained-quantity {
  font-weight: 700;
  color: #bf360c;
  font-size: 16px;
}

.reward-items-used {
  margin-top: 24px;
  margin-bottom: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.items-used-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 16px;
  text-align: center;
}

.items-used-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-used-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  padding: 16px;
  border: 2px solid #dee2e6;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-used-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.item-used-card.item-poke-ball {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border-color: #ef5350;
}

.item-used-card.item-poke-ball .item-icon {
  color: #c62828;
}

.item-used-card.item-great-ball {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-color: #42a5f5;
}

.item-used-card.item-great-ball .item-icon {
  color: #1565c0;
}

.item-used-card.item-ultra-ball {
  background: linear-gradient(135deg, #fff9c4, #fff59d);
  border-color: #fbc02d;
}

.item-used-card.item-ultra-ball .item-icon {
  color: #f57f17;
}

.item-used-card.item-master-ball {
  background: linear-gradient(135deg, #f3e5f5, #e1bee7);
  border-color: #9b59b6;
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.item-used-card.item-master-ball .item-icon {
  color: #8e44ad;
}

.item-used-card.item-master-ball:hover {
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.6);
}

.item-used-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.item-icon {
  font-size: 24px;
  line-height: 1;
}

.item-name {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  flex: 1;
}

.item-count {
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
}

.caught-pokemon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
}

.caught-pokemon-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
  transition: all 0.2s ease;
}

.caught-pokemon-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 6px rgba(76, 175, 80, 0.4);
}

.no-caught-message {
  display: inline-block;
  color: #999;
  font-size: 13px;
  font-style: italic;
  padding: 4px 0;
}

.team-exp-section {
  margin-top: 24px;
  margin-bottom: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.team-exp-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 16px;
  text-align: center;
}

.team-exp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.team-exp-pokemon-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  padding: 14px;
  border: 2px solid #dee2e6;
  transition: all 0.3s ease;
}

.team-exp-pokemon-card.leveled-up {
  background: linear-gradient(135deg, #fff9c4, #fff59d);
  border-color: #ffd700;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  animation: levelUpPulse 1.5s ease-in-out;
}

@keyframes levelUpPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
  }
}

.team-exp-pokemon-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.team-exp-pokemon-image {
  width: 50px;
  height: 50px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.team-exp-pokemon-info {
  flex: 1;
  min-width: 0;
}

.team-exp-pokemon-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 4px;
}

.team-exp-pokemon-level {
  font-size: 13px;
  color: #6c757d;
  font-weight: 600;
}

.level-up-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #8b6914;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 4px;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.team-exp-gained {
  font-size: 14px;
  font-weight: 700;
  color: #22c55e;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(34, 197, 94, 0.2);
}

.team-exp-bar-container {
  margin-top: 8px;
}

.team-exp-bar {
  position: relative;
  height: 14px;
  background: linear-gradient(to bottom, #1a1a2e, #16213e);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #3a3a5e;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.team-exp-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to bottom, #60a5fa, #3b82f6);
  border-radius: 6px;
  z-index: 1;
}

.team-exp-bar-fill-new {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to bottom, #4ade80, #22c55e);
  border-radius: 6px;
  z-index: 2;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.team-exp-pokemon-card.leveled-up .team-exp-bar-fill-new {
  background: linear-gradient(to bottom, #fbbf24, #f59e0b);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.team-exp-bar-text {
  margin-top: 4px;
  font-size: 11px;
  color: #666;
  text-align: center;
  font-weight: 500;
}

.team-exp-pokemon-card.leveled-up .team-exp-bar-text {
  color: #8b6914;
  font-weight: 600;
}

/* 조우했지만 포획하지 못한 전설/환상 포켓몬 섹션 */
.reward-encountered {
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border-radius: 12px;
  border: 2px solid #ef5350;
}

.encountered-title {
  font-size: 16px;
  font-weight: 700;
  color: #c62828;
  margin-bottom: 12px;
  text-align: center;
}

.encountered-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.encountered-pokemon {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  position: relative;
  border: 2px solid rgba(239, 83, 80, 0.4);
  transition: all 0.3s ease;
}

.encountered-pokemon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.encountered-pokemon.rarity-legendary {
  background: linear-gradient(135deg, #fff8e1, #ffe0b2);
  border-color: rgba(255, 183, 77, 0.6);
}

.encountered-pokemon.rarity-mythical {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  border-color: rgba(240, 98, 146, 0.6);
}

.encountered-pokemon .escaped-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ef5350, #c62828);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(198, 40, 40, 0.4);
  z-index: 10;
  animation: escapedPulse 2s ease-in-out infinite;
}

@keyframes escapedPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(198, 40, 40, 0.6);
  }
}

.encountered-pokemon .name {
  font-size: 11px;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 4px;
}

.encountered-pokemon.rarity-legendary .name {
  color: rgba(133, 88, 0, 1);
}

.encountered-pokemon.rarity-mythical .name {
  color: rgba(136, 14, 79, 1);
}

.encountered-pokemon .rarity-info {
  font-size: 9px;
  font-weight: 600;
  margin-top: 2px;
}

.modal-content .btn-primary {
  width: auto;
  padding: 12px 40px;
}

#confirm-modal {
  z-index: 2000;
}

.confirm-modal-content {
  max-width: 400px;
}

.confirm-modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 16px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-actions .btn-secondary {
  background: #636e72;
}

#outcry-modal .modal-content {
  max-width: 500px;
  text-align: center;
}

#outcry-message {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.1rem;
  margin-top: 10px;
  background: #f9f9f9;
  color: #333;
}

#outcry-message:focus {
  border-color: #3498db;
  outline: none;
  background: #fff;
  color: #333;
}

/* 미디어 쿼리 */
@media (max-width: 768px) {
  .modal-content {
    padding: 16px;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .modal-buttons,
  .confirm-actions {
    flex-direction: column;
    gap: 10px;
  }

  .modal-buttons .btn-primary,
  .modal-buttons .btn-secondary,
  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 12px;
  }

  .modal-content h2 {
    font-size: 18px;
  }

  .modal-desc {
    font-size: 14px;
  }
}
