/* ===== NPC spawn-locations mode (additive; does not affect boss mode) ===== */

/* Top-bar mode toggle: inherits the shared #button-container button look,
   with a distinct emerald accent so it reads as a separate mode control. */
#button-container #map-mode-button {
    box-shadow: 0 0 30px 10px rgba(46, 204, 113, 0.45);
    animation: none;
}
#button-container #map-mode-button:hover {
    box-shadow: 0 0 22px 8px rgba(46, 204, 113, 0.75), 0 0 32px 12px rgba(39, 174, 96, 0.5);
}
/* Pressed-in look while NPC mode is active */
body.mode-npc #button-container #map-mode-button {
    background: linear-gradient(145deg, #14361f, #0c1f12);
    border-color: #2ecc71;
    color: #b8f5cf;
}

/* NPC spawn dots. Markers reuse .marker_flag (so popups/centering work); .npc-dot
   restyles them into a colored spawn dot. Each NPC gets its own --dot-color
   (set inline by npc_mode.js) so overlapping NPC types are easy to tell apart.
   Centering (translate(-50%,-50%)) is inherited from .marker_flag. */
.marker_flag.npc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--dot-color, #ef3b2c);
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 5px 1px var(--dot-color, #ef3b2c), 0 1px 2px rgba(0, 0, 0, 0.6);
}
.marker_flag.npc-dot:hover {
    outline: 2px solid #fff;
    box-shadow: 0 0 10px 3px var(--dot-color, #ef3b2c), 0 1px 2px rgba(0, 0, 0, 0.6);
    z-index: 30;
}

/* While browsing NPCs: hide raid-boss flags, their animated glow halos, and the
   boss-specific timer hint. (The glow manager is also paused in JS; this is a
   belt-and-suspenders so no boss halo can animate/repaint under NPC mode.) */
body.mode-npc .marker_flag:not(.npc-dot) { display: none !important; }
body.mode-npc .marker-halo { display: none !important; }
body.mode-npc #map-timer-hint { display: none !important; }
/* Import Timer is a raid-boss feature (NPCs have no respawn timers) -> hide it in NPC mode. */
body.mode-npc #import-timer-button { display: none !important; }

/* Desktop NPC mode reuses the level slider (re-ranged to NPC levels 1–99).
   The mobile <select> shim is 20–85 and can't be re-ranged, so hide it on phones
   and let name search drive NPC mode there. */
@media (max-width: 576px) {
    body.mode-npc #slider-container { display: none; }
}

/* NPC names collide a lot (16 goblins, 85 orcs), so give the dropdown more room
   than the boss list and make it clearly scrollable. Boss mode keeps its 40vh. */
body.mode-npc #suggestions { max-height: min(72vh, 560px); }

/* Sticky "N matches" header so it's obvious how many results there are. */
.suggestion-head {
    position: sticky;
    top: 0;
    padding: 7px 10px;
    font: 600 12px 'Georgia', serif;
    color: #2a6b46;
    background: #eef7f0;
    border-bottom: 1px solid #cfe6d8;
    user-select: none;
}

/* The shared #popup is reused for both raid bosses and NPCs. masterwork can't be
   iframed (X-Frame-Options), so we render the scraped stats + drops (from
   data/npc_details.json) into .popup-info ourselves, and link out to the full
   page in a new tab. Bosses additionally show their image when one is available;
   NPC dots have none, so the popup renders card-only. */
#popup {
    flex-direction: column; /* image strip (optional) above, card below */
    background: rgba(12, 31, 18, 0.98);
    color: #eaf7ee;
    border: 1px solid rgba(46, 204, 113, 0.6);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
    font-family: 'Georgia', serif;
}
.popup-info {
    flex: 1 1 auto;
    min-height: 0; /* allow the card to scroll inside the flex column */
    box-sizing: border-box;
    overflow-y: auto;
    padding: 10px 12px;
}
.npc-info-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.npc-info-type { font-size: 12px; color: #b8f5cf; margin-bottom: 8px; }
.npc-info-loading { font-size: 12px; color: #b8f5cf; margin: 6px 0; opacity: 0.85; }

/* stat grid */
.npc-info-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 12px;
}
.npc-info-stats > div { display: flex; justify-content: space-between; gap: 8px; }
.npc-info-stats span { color: #9fd9b6; }
.npc-info-stats b { color: #fff; font-weight: 600; }

/* drop / spoil sections */
.npc-info-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7fe0a8;
    border-top: 1px solid rgba(46, 204, 113, 0.25);
    padding-top: 6px;
    margin-top: 6px;
    margin-bottom: 4px;
}
.npc-info-count { opacity: 0.7; }
.npc-info-list { font-size: 12px; }
.npc-info-row { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; font-size: 12px; }
/* drop/spoil rows mirror the stats rows: muted name on the left, white number
   on the right, same 12px size. */
.npc-info-row span { color: #cfe6d8; }
.npc-info-row i { color: #9fd9b6; font-style: normal; }
.npc-info-row b { color: #fff; font-weight: 600; white-space: nowrap; }

.npc-info-link {
    display: inline-block;
    margin-top: 8px;
    color: #7fe0a8;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid rgba(46, 204, 113, 0.5);
    border-radius: 5px;
    padding: 4px 8px;
}
.npc-info-link:hover { background: rgba(46, 204, 113, 0.15); text-decoration: underline; }

/* long attribute values (Atk/Def attribute) should wrap, not get squished */
.npc-info-stats b { white-space: normal; text-align: right; }

/* collapsible section (skills) — native <details>, styled summary as the header */
.npc-info-collapsible { margin: 0; }
.npc-info-collapsible > summary.npc-info-section {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    list-style: none; /* hide default disclosure triangle (Firefox) */
}
.npc-info-collapsible > summary.npc-info-section::-webkit-details-marker { display: none; }
.npc-info-collapsible > summary.npc-info-section::before {
    content: '▸';
    font-size: 9px;
    line-height: 1;
    color: #7fe0a8;
}
.npc-info-collapsible[open] > summary.npc-info-section::before { content: '▾'; }
.npc-info-collapsible > summary.npc-info-section:hover { color: #b8f5cf; }

/* skills */
.npc-skill { padding: 3px 0; }
.npc-skill-name { display: block; color: #eaf7ee; font-size: 12px; font-weight: 600; }
.npc-skill-name i { color: #7fe0a8; font-style: normal; font-weight: 400; }
.npc-skill-desc { display: block; color: #9fd9b6; font-size: 11px; line-height: 1.3; margin-top: 1px; }

/* drop / spoil groups (group chance header + its items) */
.npc-drop-group { margin-bottom: 6px; }
.npc-group-head { font-size: 11px; color: #ffd27a; opacity: 0.85; margin: 3px 0 1px; }
.npc-grade {
    font-size: 9px;
    padding: 0 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    color: #cfe6d8;
    vertical-align: middle;
}

/* Empty-state hint shown in NPC mode before an NPC is chosen. */
#npc-empty-hint {
    display: none;
    margin-top: 8px;
    padding: 6px 14px;
    font-family: 'Georgia', serif;
    font-size: 13px;
    color: #b8f5cf;
    text-shadow: 1px 1px 2px #000;
    background: rgba(12, 31, 18, 0.7);
    border: 1px solid rgba(46, 204, 113, 0.5);
    border-radius: 6px;
    pointer-events: none;
}
