/* /public/css/dungeon.css */

/* ===== 던전 배틀 스타일 ===== */

.dungeon-battle-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

/* 적 정보 섹션 */
.battle-enemy-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 15px;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.enemy-info {
  text-align: center;
  margin-bottom: 15px;
}

.enemy-name {
  font-size: 24px;
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.enemy-description {
  font-size: 14px;
  opacity: 0.9;
}

/* 플레이어 정보 섹션 */
.battle-player-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* HP 바 컨테이너 */
.battle-hp-container {
  margin-bottom: 10px;
}

.battle-hp-container label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

/* HP 바 */
.battle-hp-bar {
  width: 100%;
  height: 35px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 17px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.battle-hp-fill {
  height: 100%;
  transition: width 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.battle-hp-fill.player-hp {
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
}

.battle-hp-fill.monster-hp {
  background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
}

.battle-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  z-index: 1;
}

/* 전투 로그 */
.battle-log-container {
  background: white;
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.battle-log-container h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #333;
}

.battle-log {
  height: 200px;
  overflow-y: auto;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.6;
}

.battle-log-entry {
  margin-bottom: 10px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: fade-in 0.3s ease;
  color: #333;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 스킬 버튼 */
.battle-actions {
  background: white;
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.battle-actions h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #333;
}

.battle-skill-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.battle-skill-btn {
  padding: 15px;
  border: 2px solid #4a90e2;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.battle-skill-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.battle-skill-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.battle-skill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #999;
  border-color: #666;
}

.battle-skill-btn .skill-name {
  font-size: 16px;
  margin-bottom: 5px;
}

.battle-skill-btn .skill-description {
  font-size: 12px;
  opacity: 0.9;
  font-weight: normal;
}

/* ===== 새로운 아이템 등급 스타일 ===== */

/* 초월 등급 */
.item-rarity-초월 {
  background: #FFFFFF;
  color: #000000;
  border: 2px solid #333333;
  font-weight: bold;
}

/* 태초 등급 */
.item-rarity-태초 {
  background: linear-gradient(135deg, #000000 0%, #3d3d29 50%, #000000 100%);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  color: #FFFFFF;
  border: 2px solid #6b6b47;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 신성 등급 */
.item-rarity-신성 {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
  background-size: 200% 200%;
  animation: divine-shine 2s ease infinite;
  color: #FFFFFF;
  border: 2px solid #FFF;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  position: relative;
  overflow: hidden;
}

@keyframes divine-shine {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
  }
}

/* 신성 등급 파티클 효과 - 모바일 성능 최적화 */
.item-rarity-신성::before {
  content: '';
  position: absolute;
  top: -25%;
  left: -25%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  animation: particle-rotate 4s linear infinite;
  will-change: transform;
}

@keyframes particle-rotate {
  0% { transform: rotate3d(0, 0, 1, 0deg); }
  100% { transform: rotate3d(0, 0, 1, 360deg); }
}

/* ===== 퀘스트 모달 스타일 ===== */

.quest-offer-modal {
  text-align: left;
}

.quest-offer-description {
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: 500;
}

.quest-offer-details {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.quest-offer-rewards {
  background: #fff3cd;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #ffc107;
}

.quest-offer-rewards h4 {
  margin: 0 0 10px 0;
  color: #856404;
}

.bonus-text {
  color: #ffc107;
  font-weight: bold;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== 아이템 획득 모달 스타일 ===== */

.item-acquisition-modal {
  text-align: center;
}

.item-acquisition-modal .modal-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  margin: 10px 0;
}

.item-acquisition-modal .hint-text {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.item-acquired-modal {
  padding: 20px;
}

.item-card {
  padding: 20px;
  border-radius: 15px;
  margin: 10px 0;
  text-align: center;
}

.item-card h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
}

.item-rarity-badge {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.3);
}

.item-description {
  font-size: 14px;
  line-height: 1.6;
}

/* ===== 던전 클리어 모달 스타일 ===== */

.dungeon-clear-modal {
  text-align: center;
}

.dungeon-clear-modal h3 {
  font-size: 24px;
  margin: 0 0 15px 0;
  color: #4ade80;
}

.clear-stats, .clear-rewards {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  text-align: left;
}

.clear-stats h4, .clear-rewards h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #333;
}

.clear-stats p, .clear-rewards p {
  margin: 5px 0;
  font-size: 14px;
}

/* ===== 모바일 반응형 ===== */

@media (max-width: 768px) {
  .dungeon-battle-container {
    padding: 10px;
  }
  
  .battle-skill-buttons {
    grid-template-columns: 1fr;
  }
  
  .battle-skill-btn {
    padding: 12px;
  }
  
  .battle-log {
    height: 150px;
  }
  
  .enemy-name {
    font-size: 20px;
  }
  
  /* 모바일에서 헤더 버튼이 잘리지 않도록 */
  .content-header {
    flex-wrap: wrap;
  }
  
  .content-header h2 {
    font-size: 20px;
  }
  
  .abandon-dungeon-btn {
    font-size: 13px;
    padding: 0.4rem 0.8rem;
  }
}

/* 던전 포기 버튼 */
.abandon-dungeon-btn {
  background: rgba(220, 38, 38, 0.25);
  border: 2px solid rgba(220, 38, 38, 0.5);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.abandon-dungeon-btn:hover {
  background: rgba(220, 38, 38, 0.4);
  border-color: rgba(239, 68, 68, 0.7);
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.abandon-dungeon-btn:active {
  transform: scale(0.98);
}

.abandon-dungeon-btn i {
  font-size: 16px;
}

/* 던전 헤더 스타일 */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}

.content-header h2 {
  flex: 1;
  margin: 0;
  min-width: 0; /* 텍스트가 너무 길 때 줄임표 허용 */
}
