/* === History Map & Redlining Map === */

.history-map-container {
    --bg-black:       #050208;
    --purple-electric:#bf77ff;
    --purple-royal:   #9d00ff;
    --purple-light:   #e0b0ff;
    --text-primary:   #ffffff;
    --text-secondary: #c9b3ff;

    display: flex;
    flex-direction: column;
    height: 1200px;
    max-width: 1700px;
    margin: 10px auto;
    background: var(--bg-black);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    z-index: 10;
    border: 1px solid #1a0b30;
}

/* Header */
.history-map-container .header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 40px 15px;
    background: linear-gradient(to bottom, #0f051a, #050208);
    border-bottom: 1px solid #3d1a5e;
    gap: 8px;
}
.history-map-container .header-text .byline {
    font-size: 10px; font-weight: 700; letter-spacing: 2px;
    color: var(--purple-electric); text-transform: uppercase; margin-bottom: 4px;
}
.history-map-container .header-text h1 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 300; margin: 0; letter-spacing: 1px; text-transform: uppercase;
    background: linear-gradient(to right, #ffffff, #bf77ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1.2;
}
.history-map-container .header-text .sub {
    font-size: 11px; color: var(--text-secondary); margin-top: 4px;
    letter-spacing: 1px; text-transform: uppercase;
}
.history-map-container .legend { display: flex; gap: 25px; margin-top: 5px; }
.history-map-container .leg {
    display: flex; align-items: center; gap: 10px;
    font-size: 10px; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 1px;
}
.history-map-container .leg-swatch {
    width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor;
}
.history-map-container .leg-diamond {
    width: 8px; height: 8px; transform: rotate(45deg);
    background: var(--purple-electric); box-shadow: 0 0 8px var(--purple-electric);
}

/* Main Content */
.history-map-container .main-content {
    flex: 1; display: flex; min-height: 0; background: var(--bg-black);
}

/* Map Wrap */
.history-map-container .map-wrap {
    flex: 1; position: relative; background: #08030c;
    cursor: crosshair; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.history-map-container #the-map,
.history-map-container #redline-svg {
    width: 100%; height: 100%; max-height: 100%;
}
.history-map-container .map-image-v2 {
    filter: sepia(1) hue-rotate(245deg) brightness(0.5) contrast(1.4) saturate(1.8);
    opacity: 0.85;
}

/* Panel */
.history-map-container .panel {
    width: 350px;
    background: #0a0412;
    border-left: 1px solid #3d1a5e;
    display: flex; flex-direction: column;
}
.history-map-container .panel-head {
    padding: 25px;
    font-size: 1.2rem; font-weight: 700;
    text-transform: uppercase; color: #fff;
    border-bottom: 1px solid #2a0e4a;
}
.history-map-container .tabs { display: flex; border-bottom: 1px solid #2a0e4a; }
.history-map-container .tab {
    flex: 1; padding: 12px;
    font-size: 10px; color: #6a4c93;
    text-transform: uppercase; letter-spacing: 2px;
    border: none; border-bottom: 2px solid transparent;
    background: none; cursor: pointer;
}
.history-map-container .tab.on { color: #fff; border-bottom-color: var(--purple-electric); }
.history-map-container .panel-body { flex: 1; overflow-y: auto; }

/* Detail Pane */
.history-map-container .det { padding: 25px; text-align: left; }
.history-map-container .det-title {
    font-size: 1.6rem; font-weight: 800;
    text-transform: uppercase; margin-bottom: 12px; color: #fff; line-height: 1.1;
}
.history-map-container .det-loc {
    color: var(--purple-electric); font-weight: 700;
    font-size: 10px; text-transform: uppercase; margin-bottom: 15px; letter-spacing: 1px;
}
.history-map-container .det-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; }
.history-map-container .det-stat {
    background: #130826; border: 1px solid #3d1a5e;
    padding: 15px; border-radius: 4px;
}
.history-map-container .det-stat-n { font-size: 1rem; font-weight: 700; color: #fff; display: block; }
.history-map-container .det-stat-l { color: #8a6ecf; display: block; font-size: 9px; text-transform: uppercase; }
.history-map-container .det-body { font-size: 14px; color: #dcd0ff; line-height: 1.6; margin-top: 10px; }
.history-map-container .det-src  { font-size: 10px; color: #4a2d7a; margin-top: 15px; text-transform: uppercase; }

/* Empty state */
.history-map-container .empty { padding: 40px 25px; text-align: center; }
.history-map-container .empty-icon { font-size: 2rem; display: block; margin-bottom: 10px; color: #3d1a5e; }
.history-map-container .empty h3 { color: #fff; font-size: 1rem; text-transform: uppercase; margin: 0 0 10px; }
.history-map-container .empty p  { color: #666; font-size: 0.85rem; line-height: 1.5; margin: 0; }

/* Tooltip */
.history-map-container .map-tooltip {
    position: absolute; pointer-events: none; z-index: 100;
    background: #4b0082; border: 2px solid #bf77ff;
    color: #fff; padding: 5px 10px;
    font-size: 11px; font-weight: 900; text-transform: uppercase;
    box-shadow: 0 0 20px rgba(191,119,255,0.6);
    white-space: nowrap;
}

/* List Pane */
.history-map-container .list-sec {
    background: #0f051a; color: #8a6ecf;
    padding: 8px 20px; font-size: 9px; font-weight: 800; text-transform: uppercase;
}
.history-map-container .list-row {
    padding: 12px 20px; border-bottom: 1px solid #1a0b30;
    cursor: pointer; transition: background 0.2s; text-align: left;
    display: flex; align-items: center; gap: 10px;
}
.history-map-container .list-row:hover { background: #1a0b30; }
.history-map-container .list-name { color: #fff; font-weight: 600; font-size: 13px; }
.history-map-container .list-sub  { color: #8a6ecf; font-size: 11px; }
.history-map-container .list-dot  { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Footer */
.history-map-container > footer.footer {
    background: #050208; color: #4a2d7a;
    padding: 15px; font-size: 10px; text-transform: uppercase;
    border-top: 1px solid #1a0b30; text-align: center;
}

/* SVG clickable groups */
.history-map-container .clickable { cursor: pointer; }
.history-map-container .site-bg   { fill: transparent; }
.history-map-container .free-bg   { fill: transparent; }
.history-map-container .port-bg   { fill: transparent; }
.history-map-container .port-icon { font-size: 10px; text-anchor: middle; dominant-baseline: central; }
.history-map-container .port-label{ font-size: 10px; text-anchor: middle; font-weight: 700; }

@media (max-width: 768px) {
    .history-map-container { height: 900px; }
    .history-map-container .panel { width: 100%; border-left: none; border-top: 1px solid #3d1a5e; }
    .history-map-container .main-content { flex-direction: column; }
}
