/* ===================================================================
   CODEX MODALS & AUTHENTIC AION COMPONENTS
   - Authentic In-Game Target Rank Circle (1 to 6 Glowing Points)
   - Authentic In-Game Vitality Health Gauge
   - Full Interactive 2D Map Viewer & Spawns Radar
   - Complete Thematic Loot Grid
   - Quest Detail Modal & Chain Navigation
   - Dynamic Stats Multi-Select Filter Dropdown
   =================================================================== */

/* --- AUTHENTIC IN-GAME TARGET RANK CIRCLE (1 to 6 Dots) --- */
.aion-target-circle-hud {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, #7f1d1d 0%, #450a0a 65%, #180303 100%);
  border: 2.5px solid #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.65), inset 0 0 10px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.aion-target-circle-hud.rank-boss {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.75), inset 0 0 12px rgba(239, 68, 68, 0.85);
  background: radial-gradient(circle, #991b1b 0%, #5c0707 65%, #240202 100%);
}

.aion-target-circle-hud.rank-elite {
  border-color: #c084fc;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.65), inset 0 0 10px rgba(88, 28, 135, 0.85);
  background: radial-gradient(circle, #581c87 0%, #2e1065 65%, #12042b 100%);
}

.aion-target-circle-hud.rank-normal {
  border-color: #64748b;
  box-shadow: 0 0 12px rgba(100, 116, 139, 0.4), inset 0 0 8px rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle, #334155 0%, #1e293b 65%, #0f172a 100%);
}

.aion-hud-emblem-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
}

.aion-target-dots-hud {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  background: rgba(3, 7, 18, 0.9);
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.aion-hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 5px #ffffff;
}

.aion-hud-dot.gold {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24, 0 0 10px #f59e0b;
}

.aion-hud-dot.purple {
  background: #e9d5ff;
  box-shadow: 0 0 5px #c084fc;
}

/* --- AUTHENTIC IN-GAME VITALITY HEALTH GAUGE --- */
.aion-hud-gauge-container {
  width: 100%;
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.aion-hud-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.76rem;
}

.aion-hud-gauge-label {
  color: #f87171;
  font-weight: 700;
  letter-spacing: 1px;
}

.aion-hud-gauge-value {
  color: #fff;
  font-weight: 600;
}

.aion-hud-gauge-bar {
  width: 100%;
  height: 18px;
  background: #070a12;
  border-radius: 4px;
  border: 1.5px solid #334155;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9);
}

.aion-hud-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #991b1b 0%, #dc2626 40%, #ea580c 80%, #fbbf24 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
  position: relative;
  transition: width 0.3s ease;
}

.aion-hud-gauge-gloss {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
}

/* --- UNIFIED MODAL SHELL (MONSTER & QUEST) --- */
.codex-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(14px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.codex-modal-backdrop.active,
.codex-modal-backdrop.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.codex-modal-window {
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.98), rgba(9, 13, 22, 0.98));
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 16px;
  width: 95%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(96, 165, 250, 0.12);
  animation: codexModalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.codex-modal-window.monster-modal-window {
  max-width: 1140px;
  height: 88vh;
  max-height: 920px;
}

@keyframes codexModalEnter {
  from {
    transform: scale(0.96) translateY(12px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.codex-modal-header {
  padding: 16px 22px;
  background: rgba(11, 16, 28, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.codex-modal-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.codex-modal-title {
  font-family: 'Cinzel', 'Philosopher', serif;
  font-size: 1.45rem;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.codex-modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.codex-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

/* MASTER TABS IN MONSTER MODAL */
.mob-master-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(6, 9, 16, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.mob-master-tab-btn {
  background: rgba(18, 24, 38, 0.75);
  border: 1px solid rgba(147, 197, 253, 0.18);
  color: #94a3b8;
  padding: 7px 16px;
  border-radius: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mob-master-tab-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.4);
}

.mob-master-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.15));
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.codex-modal-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* --- 2D MAP VIEWER STYLING (EMBEDDED) --- */
.map-view-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.map-zones-bar {
  display: flex;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(6, 9, 15, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: thin;
  flex-shrink: 0;
  align-items: center;
}

.map-zone-pill {
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(147, 197, 253, 0.18);
  color: #cbd5e1;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-family: 'Space Mono', monospace;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}

.map-zone-pill:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.4);
}

.map-zone-pill.active {
  background: rgba(6, 182, 212, 0.22);
  border-color: #06b6d4;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.map-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #05070d;
  cursor: grab;
  user-select: none;
}

.map-viewport:active {
  cursor: grabbing;
}

.map-viewport-hint {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  background: rgba(5, 7, 13, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: #94a3b8;
  pointer-events: none;
}

.map-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 3072px;
  height: 3072px;
  transform-origin: 0 0;
  will-change: transform;
}

.map-base-img {
  width: 3072px;
  height: 3072px;
  display: block;
  pointer-events: none;
}

.map-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 3072px;
  height: 3072px;
  pointer-events: none;
}

.map-svg-overlay g {
  pointer-events: auto;
}

@keyframes radarPulseAnim {
  0% {
    r: 6px;
    opacity: 0.95;
  }
  60% {
    opacity: 0.4;
  }
  100% {
    r: 48px;
    opacity: 0;
  }
}

.radar-pulse-elem {
  animation: radarPulseAnim 2.2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

.map-footer-bar {
  padding: 8px 18px;
  background: rgba(10, 14, 24, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 0.74rem;
  color: #cbd5e1;
  flex-shrink: 0;
}

.map-zoom-controls {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.map-ctrl-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.map-ctrl-btn:hover {
  background: rgba(96, 165, 250, 0.2);
  color: #fff;
}

.map-ctrl-btn.active {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* --- THEMATIC LOOT VIEW --- */
.loot-view-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.loot-search-row {
  display: flex;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(8, 11, 18, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.loot-search-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
}

.loot-search-input:focus {
  border-color: #38bdf8;
}

.loot-grid-scroll {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  align-content: start;
}

.loot-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.loot-item-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* --- DYNAMIC STATS MULTI-SELECT DROPDOWN --- */
.stats-filter-wrapper {
  position: relative;
  display: inline-block;
}

.stats-filter-btn {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(147, 197, 253, 0.25);
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.stats-filter-btn:hover {
  border-color: #f59e0b;
  color: #fff;
}

.stats-filter-btn.has-selection {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

.stats-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: #0d121f;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  z-index: 500;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-filter-search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.stats-search-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
}

.stats-search-input:focus {
  border-color: #38bdf8;
}

.btn-clear-stats {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-clear-stats:hover {
  background: #ef4444;
  color: #fff;
}

.stats-filter-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  color: #cbd5e1;
  transition: background 0.15s ease;
}

.stat-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.stat-checkbox-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: #f59e0b;
}

.stat-count-chip {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: #64748b;
}

/* --- QUEST OBTENTION BUTTON & LIST --- */
.btn-quest-obtention {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #6ee7b7 !important;
}

.btn-quest-obtention:hover {
  background: #10b981 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
}

.quest-item-card {
  background: rgba(14, 20, 34, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quest-item-card:hover {
  border-color: #f59e0b;
  background: rgba(24, 34, 56, 0.9);
  transform: translateX(4px);
}

/* 3D TABS AND BUTTONS IN MONSTER MODAL */
.mob-master-tab-btn#tabBtn3D.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.15)) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

.mob-3d-ext-nav-btn:hover {
  background: rgba(56, 189, 248, 0.3) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}
