/* ── network-map.css ─────────────────────────────────────────────────────────
   Red de mitigación: real-time global filtering visualization panel.
   Shared by /transito-ip and /conectividad-ip via partials/ddos-map.blade.php.
   No box-shadows (theme rule) — elevation via borders + contrast only.
   Canvas JS reads the --map-* custom properties below via getComputedStyle. */

.ddos-map-panel {
    --map-bg: var(--paper-2);
    --map-dot: rgba(13, 17, 23, .20);
    --map-clean: var(--brand);
    --map-attack: var(--danger);
    --map-mitigated: var(--green);
    --map-node-idle: var(--text-3);
    --map-label: var(--text-2);

    margin-top: 40px;
    background: var(--map-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

:root[data-theme="dark"] .ddos-map-panel {
    --map-bg: var(--ink-2);
    --map-dot: rgba(247, 243, 234, .16);
}

/* ── HUD row ── */

.ddos-map-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 32px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-dim);
}

.ddos-map-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 110px;
}

.ddos-map-stat-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.ddos-map-stat-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.15;
    color: var(--text-1);
    font-variant-numeric: tabular-nums;
    transition: color var(--transition-base);
}

.ddos-map-stat-value.is-attack {
    color: var(--danger);
}

/* ── Status pill ── */

.ddos-map-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .03em;
    white-space: nowrap;
}

.ddos-map-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: ddosMapDotPulse 2.4s ease-in-out infinite;
}

.ddos-map-status.is-stable {
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid rgba(78, 118, 86, .38);
}

.ddos-map-status.is-attack {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(184, 74, 58, .40);
}

.ddos-map-status.is-attack .ddos-map-status-dot {
    animation-duration: .9s;
}

/* Dark: same pattern as the home-ddos status pill — lightened semantic text
   over the alpha-tint soft backgrounds (token hexes are too dim on ink). */
:root[data-theme="dark"] .ddos-map-status.is-stable {
    color: #BFE4C5;
    border-color: rgba(78, 118, 86, .50);
}

:root[data-theme="dark"] .ddos-map-status.is-attack {
    color: #ECB7AB;
    border-color: rgba(184, 74, 58, .55);
}

@keyframes ddosMapDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* ── Capacity meter ── */

.ddos-map-capacity {
    flex: 1 1 260px;
    min-width: 230px;
    gap: 8px;
}

.ddos-map-capacity-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.ddos-map-capacity-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ddos-map-capacity-track {
    position: relative;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--border-dim);
}

/* 2 Tbps threshold tick (2/6 of the scale) — past it, ingress moves to FRA */
.ddos-map-capacity-track::after {
    content: "";
    position: absolute;
    left: 33.333%;
    top: -3px;
    bottom: -3px;
    width: 2px;
    border-radius: 1px;
    background: var(--text-3);
    opacity: .55;
}

.ddos-map-capacity-fill {
    display: block;
    height: 100%;
    width: 4%;
    border-radius: var(--radius-pill);
    background: var(--brand);
    transition: width .25s linear, background-color var(--transition-slow);
}

.ddos-map-capacity-fill.is-over {
    background: var(--danger);
}

/* ── Canvas ── */

.ddos-map-canvas-wrap {
    position: relative;
    height: 520px;
}

.ddos-map-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Footer: legend + POPs + caption ── */

.ddos-map-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    padding: 13px 22px 15px;
    border-top: 1px solid var(--border-dim);
}

.ddos-map-legend,
.ddos-map-pops {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
}

.ddos-map-legend li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--text-2);
}

.ddos-map-key {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.ddos-map-key.is-clean { background: var(--brand); }
.ddos-map-key.is-attack { background: var(--danger); }
.ddos-map-key.is-mitigated { background: var(--green); }

.ddos-map-pops li {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
}

.ddos-map-pops strong {
    font-weight: 600;
    color: var(--text-2);
}

.ddos-map-caption {
    flex-basis: 100%;
    margin: 0;
    font-size: 11.5px;
    color: var(--text-3);
}

/* ── Responsive ── */

@media (max-width: 720px) {
    .ddos-map-canvas-wrap {
        height: 400px;
    }

    .ddos-map-hud {
        gap: 14px 22px;
        padding: 15px 16px;
    }

    .ddos-map-stat {
        min-width: 96px;
    }

    .ddos-map-stat-value {
        font-size: 17px;
    }

    .ddos-map-foot {
        padding: 12px 16px 14px;
    }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
    .ddos-map-status-dot {
        animation: none;
    }

    .ddos-map-capacity-fill {
        transition: none;
    }
}
