/* ============================================================
   Whiteout Event Hub Â· World Map Styles
   ============================================================ */

/* ââ Map Container ââ */
.wm-wrapper {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

#map-container {
    width: 100%;
    aspect-ratio: 4/3;
    max-height: 720px;
    overflow: hidden;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: #060f18;
    cursor: grab;
    user-select: none;
    position: relative;
}
#map-container:active { cursor: grabbing; }

#map-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ââ Diamond Background ââ */
.wm-diamond-bg {
    fill: rgba(255,255,255,0.04);
    stroke: rgba(255,255,255,0.25);
    stroke-width: 1;
}

/* ââ Map Controls ââ */
.wm-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}
.wm-ctrl-btn {
    width: 32px; height: 32px;
    background: rgba(13,34,51,0.9);
    border: 1px solid var(--border2);
    border-radius: 4px;
    color: var(--ice);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.wm-ctrl-btn:hover { background: rgba(40,80,120,0.95); }
.wm-ctrl-btn:active { transform: scale(0.95); }

/* ââ Stats / Legend ââ */
.wm-stats {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(13,34,51,0.6);
    border: 1px solid var(--border2);
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--ice);
}
.wm-stat strong { color: #fff; margin-left: 4px; }
.wm-warn { color: #ffb84a; }

.wm-legend {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(13,34,51,0.4);
    border: 1px solid var(--border2);
    border-radius: 4px;
    font-size: 12px;
    color: var(--ice);
}
.wm-legend-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.wm-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.wm-legend-dot {
    width: 12px; height: 12px;
    border-radius: 2px;
    display: inline-block;
}
.wm-legend-abbr {
    color: rgba(255,255,255,0.5);
    margin-left: 2px;
}

/* ââ Player Marker ââ */
.wm-player-city {
    cursor: pointer;
    transition: filter 0.1s;
}
.wm-player-city:hover {
    filter: brightness(1.2) drop-shadow(0 0 6px rgba(255,255,255,0.5));
}

/* ââ Tooltip ââ */
#wm-tooltip {
    display: none;
    position: fixed;
    z-index: 100;
    padding: 8px 12px;
    background: rgba(8,20,32,0.97);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: var(--ice);
    font-size: 12px;
    min-width: 180px;
    max-width: 280px;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.wm-tt-name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    margin-bottom: 4px;
}
.wm-tt-row {
    margin: 2px 0;
    color: rgba(220,235,250,0.85);
}
.wm-tt-debug {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,0.15);
    color: rgba(255,200,100,0.9);
    font-family: monospace;
    font-size: 11px;
}
.wm-tt-notes {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    font-style: italic;
    font-size: 11px;
}

/* ââ Embed Mode (used by mobile iframe) ââ */
.wm-embed {
    /* Mobile iframe mode: hide header bits */
}
.wm-embed .wm-header-large { display: none; }

/* ââ Admin (world_map_manage.php) ââ */
.wm-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wm-admin-table th {
    background: rgba(255,255,255,0.05);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--ice);
    border-bottom: 1px solid var(--border2);
}
.wm-admin-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: rgba(220,235,250,0.85);
}
.wm-admin-table tr:hover td { background: rgba(255,255,255,0.03); }

.wm-admin-row .wm-alliance-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}

.wm-admin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}
.wm-admin-modal.active { display: flex; }
.wm-admin-modal-content {
    background: #0d2233;
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 20px;
    min-width: 460px;
    max-width: 580px;
    color: var(--ice);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.wm-admin-modal h3 {
    margin: 0 0 14px 0;
    color: #fff;
    font-size: 18px;
}

.wm-admin-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}
.wm-admin-field label {
    font-size: 12px;
    color: rgba(220,235,250,0.7);
    margin-bottom: 4px;
}
.wm-admin-field input,
.wm-admin-field textarea {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 6px 10px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
}
.wm-admin-field input:focus,
.wm-admin-field textarea:focus {
    outline: none;
    border-color: var(--ice);
}

.wm-admin-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    margin-top: 8px;
}
.wm-admin-preview svg {
    background: #060f18;
    border-radius: 3px;
}
.wm-admin-preview-meta {
    font-size: 11px;
    color: rgba(220,235,250,0.6);
    font-family: monospace;
}

.wm-admin-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}
.wm-admin-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border2);
    background: rgba(255,255,255,0.05);
    color: var(--ice);
    transition: background 0.15s;
}
.wm-admin-btn:hover { background: rgba(255,255,255,0.1); }
.wm-admin-btn.primary {
    background: #2c7fb8;
    border-color: #2c7fb8;
    color: #fff;
}
.wm-admin-btn.primary:hover { background: #3a91cf; }
.wm-admin-btn.danger {
    background: #b8392c;
    border-color: #b8392c;
    color: #fff;
}
.wm-admin-btn.danger:hover { background: #cf4a3a; }
.wm-admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wm-admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    align-items: center;
}
.wm-admin-toolbar input,
.wm-admin-toolbar select {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 6px 10px;
    color: #fff;
    font-size: 13px;
}

/* ============================================================ */
/* Public Search Toolbar (Iteration 9)                          */
/* ============================================================ */
.wm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: rgba(13,34,51,0.6);
    border: 1px solid var(--border2);
    border-radius: 6px;
    align-items: flex-end;
}
.wm-toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wm-toolbar-group label {
    font-size: 11px;
    color: rgba(220,235,250,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Rajdhani', sans-serif;
}
.wm-toolbar-group select,
.wm-toolbar-group input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    min-width: 200px;
    transition: border-color 0.15s;
}
.wm-toolbar-group select:focus,
.wm-toolbar-group input:focus {
    outline: none;
    border-color: var(--ice);
    background: rgba(255,255,255,0.08);
}
.wm-toolbar-hint {
    margin-left: auto;
    font-size: 11px;
    color: rgba(220,235,250,0.4);
    max-width: 240px;
    line-height: 1.4;
    align-self: center;
}
.wm-toolbar-hint code {
    background: rgba(255,255,255,0.06);
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
}
.wm-toolbar-notice {
    padding: 8px 12px;
    background: rgba(255,184,74,0.12);
    border: 1px solid rgba(255,184,74,0.4);
    border-radius: 4px;
    color: #ffb84a;
    font-size: 12px;
    margin-bottom: 12px;
    display: none;
}
.wm-toolbar-notice.show { display: block; }

/* ============================================================ */
/* Custom Player Search Dropdown (Iteration 9 v2)               */
/* ============================================================ */
.wm-search-player-wrap {
    position: relative;
}
.wm-search-player-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(8,18,28,0.97);
    border: 1px solid var(--border2);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
}
.wm-search-player-results.show { display: block; }
.wm-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.1s;
}
.wm-search-result:last-child { border-bottom: none; }
.wm-search-result:hover,
.wm-search-result.active {
    background: rgba(40,80,120,0.4);
}
.wm-search-result-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}
.wm-search-result-meta {
    flex: 1;
    min-width: 0;
}
.wm-search-result-name {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wm-search-result-sub {
    font-size: 11px;
    color: rgba(220,235,250,0.5);
    margin-top: 1px;
}
.wm-search-result-abbr {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.wm-search-empty {
    padding: 12px;
    text-align: center;
    color: rgba(220,235,250,0.5);
    font-size: 12px;
}
