/* ==========================================================================
   Ashes of Fallen World - Monster Database & Bestiary Stylesheet
   Dark Fantasy RPG Monster Cards, Type Auras & Stat Inspection
   ========================================================================== */

/* Type Badges */
.monster-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.monster-type-badge.type-normal {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.monster-type-badge.type-alt-boss {
  background: rgba(229, 169, 59, 0.18);
  border: 1px solid var(--border-gold-bright);
  color: var(--accent-gold-light);
  box-shadow: 0 0 12px rgba(229, 169, 59, 0.3);
}

.monster-type-badge.type-continent-boss {
  background: linear-gradient(135deg, rgba(201, 59, 59, 0.3) 0%, rgba(139, 29, 29, 0.4) 100%);
  border: 1px solid var(--accent-crimson-bright);
  color: #fca5a5;
  box-shadow: 0 0 18px rgba(201, 59, 59, 0.45);
  animation: pulse-boss-glow 2.5s infinite ease-in-out;
}

@keyframes pulse-boss-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(201, 59, 59, 0.3); }
  50% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.7); }
}

/* Monster Cards Grid */
.monster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.monster-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.monster-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(229, 169, 59, 0.2);
}

.monster-card.card-alt-boss {
  border-color: rgba(229, 169, 59, 0.4);
  background: linear-gradient(180deg, rgba(26, 31, 44, 0.9) 0%, rgba(20, 24, 33, 0.95) 100%);
}

.monster-card.card-continent-boss {
  border-color: rgba(201, 59, 59, 0.5);
  background: linear-gradient(180deg, rgba(35, 20, 25, 0.9) 0%, rgba(20, 24, 33, 0.95) 100%);
  box-shadow: 0 4px 20px rgba(201, 59, 59, 0.2);
}

.monster-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.monster-location-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Monster Sprite Visual Box */
.monster-visual-box {
  width: 100%;
  height: 140px;
  background: radial-gradient(circle at center, rgba(30, 36, 50, 0.6) 0%, rgba(10, 12, 16, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.monster-sprite-frame {
  display: block;
  height: 110px;
  max-width: 90%;
  aspect-ratio: var(--sprite-frame-aspect, 1);
  overflow: hidden;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8));
  transition: transform 0.3s ease;
}

.monster-sprite-frame img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
}

.monster-card:hover .monster-sprite-frame {
  transform: scale(1.08);
}

.monster-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.25;
}

.monster-card.card-alt-boss .monster-name {
  color: var(--accent-gold-light);
}

.monster-card.card-continent-boss .monster-name {
  color: #fca5a5;
}

.monster-level-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Quick Stat Bars on Card */
.monster-stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.monster-stat-mini {
  display: flex;
  flex-direction: column;
}

.monster-stat-mini span:first-child {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.monster-stat-mini span:last-child {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.monster-stat-mini.stat-hp span:last-child {
  color: #ef4444;
}

.monster-stat-mini.stat-dmg span:last-child {
  color: var(--accent-gold);
}

/* Enchant Badges */
.monster-enchants-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.enchant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
  font-size: 0.72rem;
  font-weight: 600;
}

.enchant-tag i {
  font-size: 0.65rem;
}

/* ==========================================================================
   Monster Detailed Inspector Modal
   ========================================================================== */
.monster-modal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.monster-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.monster-modal-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
}

.monster-modal-avatar {
  width: 100%;
  height: 160px;
  background: radial-gradient(circle at center, rgba(35, 42, 60, 0.8) 0%, rgba(10, 12, 16, 0.95) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(229, 169, 59, 0.3);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.monster-modal-avatar .monster-sprite-frame {
  height: 130px;
  max-width: 90%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.9));
}

.monster-modal-bio h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.monster-modal-bio p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Modal 8-Stat Grid */
.monster-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-box {
  background: #141822;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.stat-box-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-box-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-body);
}

.stat-box.hp-box .stat-box-value { color: #ef4444; }
.stat-box.dmg-box .stat-box-value { color: var(--accent-gold); }
.stat-box.speed-box .stat-box-value { color: #60a5fa; }
.stat-box.def-box .stat-box-value { color: #34d399; }
.stat-box.dr-box .stat-box-value { color: #fbbf24; }

/* Enchants & Skills Section in Modal */
.modal-section-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

.enchants-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enchant-detail-item {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.enchant-detail-item h5 {
  color: #d8b4fe;
  font-size: 0.92rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.enchant-detail-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Boss Drop Showcase Grid (NO PERCENTAGES) */
.boss-drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.boss-drop-card {
  background: #141722;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.boss-drop-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold-light);
  box-shadow: 0 4px 15px rgba(229, 169, 59, 0.2);
}

.boss-drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #090a0e;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}

.boss-drop-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.boss-drop-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 2px;
}

.boss-drop-type {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Responsive Modal and Grids */
@media (max-width: 768px) {
  .monster-modal-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .monster-modal-avatar {
    margin: 0 auto;
    max-width: 200px;
  }
  .monster-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .monster-grid {
    grid-template-columns: 1fr;
  }
  .monster-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-box {
    padding: 8px 10px;
  }
  .stat-box-value {
    font-size: 0.95rem;
  }
  .boss-drop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
