/* Stats and Threats Combined Section */
.stats-and-threats-section {
    background: linear-gradient(135deg, var(--wfs-dark) 0%, #0f0f0f 100%);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.stats-and-threats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--wfs-yellow), transparent);
}

.text-center {
    text-align: center;
}

.section-badge {
    display: inline-block;
    background: rgba(229, 199, 56, 0.1);
    color: var(--wfs-yellow);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    border: 1px solid rgba(229, 199, 56, 0.2);
}

/* Threat Monitor Wrapper */
.threat-monitor-wrapper {
    margin: 40px 0;
}

/* Threat Monitor Canvas */
.world-map-canvas {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.8) 0%, rgba(25, 25, 25, 0.6) 100%);
    border-radius: 20px;
    border: 1px solid rgba(229, 199, 56, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

#threatMapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.map-overlay-stats {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

.live-stat-box,
.legend-box {
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid rgba(229, 199, 56, 0.2);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.live-stat-box h4,
.legend-box h4 {
    font-size: 0.85rem;
    color: var(--wfs-yellow);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.stat-line:last-child {
    margin-bottom: 0;
}

.stat-line .stat-label {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.stat-line .stat-value {
    color: #ffffff;
    font-weight: 600;
}

.stat-line .stat-value.critical {
    color: #ef4444;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.main-sensor {
    background: var(--wfs-yellow);
    box-shadow: 0 0 10px var(--wfs-yellow);
}

.legend-dot.local-sensor {
    background: rgba(229, 199, 56, 0.5);
    box-shadow: 0 0 8px rgba(229, 199, 56, 0.5);
}

.legend-dot.threat {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

/* Mobile Threat View (hidden on desktop) */
.mobile-threat-view {
    display: none;
}

/* Stats Row - Compact Cards Below Map */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.stat-card-compact {
    text-align: center;
    padding: 20px 15px;
    background: rgba(229, 199, 56, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(229, 199, 56, 0.1);
    transition: all 0.3s;
}

.stat-card-compact:hover {
    background: rgba(229, 199, 56, 0.06);
    border-color: rgba(229, 199, 56, 0.3);
    transform: translateY(-2px);
}

.stat-card-compact .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--wfs-yellow);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-card-compact .stat-number .unit {
    font-size: 1.2rem;
    color: var(--wfs-yellow);
    opacity: 0.7;
}

.stat-card-compact .stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Attack Patterns */
#attack-patterns-container {
    margin-top: 40px;
}

/* Noscript notice */
.noscript-notice {
    background: rgba(229, 199, 56, 0.1);
    border: 1px solid #e5c738;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

/* Tablet: Adjust stats row */
@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .world-map-canvas {
        height: 400px;
    }

    .map-overlay-stats {
        top: 10px;
        right: 10px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .stats-and-threats-section {
        padding: 60px 0;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card-compact {
        padding: 18px 12px;
    }

    .stat-card-compact .stat-number {
        font-size: 1.5rem;
    }

    .stat-card-compact .stat-label {
        font-size: 0.75rem;
    }

    /* Hide desktop threat monitor, show mobile version */
    .world-map-canvas {
        display: none;
    }

    .mobile-threat-view {
        display: block;
        margin-bottom: 30px;
    }

    .mobile-core-visual {
        position: relative;
        width: 200px;
        height: 200px;
        margin: 0 auto 30px;
    }

    .mobile-core {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, var(--wfs-yellow), #d4af37);
        border-radius: 50%;
        box-shadow: 0 0 30px var(--wfs-yellow);
        animation: pulse 2s ease-in-out infinite;
    }

    .mobile-core-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: var(--wfs-dark);
        font-weight: 700;
        font-size: 1.2rem;
        z-index: 2;
    }

    .mobile-sensors {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .mobile-sensor {
        position: absolute;
        width: 12px;
        height: 12px;
        background: rgba(229, 199, 56, 0.6);
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(229, 199, 56, 0.6);
    }

    .mobile-sensor:nth-child(1) { top: 10%; left: 50%; transform: translateX(-50%); animation: sensorPulse 1.5s ease-in-out infinite; }
    .mobile-sensor:nth-child(2) { top: 30%; right: 10%; animation: sensorPulse 1.8s ease-in-out infinite; }
    .mobile-sensor:nth-child(3) { top: 60%; right: 20%; animation: sensorPulse 2.1s ease-in-out infinite; }
    .mobile-sensor:nth-child(4) { bottom: 10%; left: 50%; transform: translateX(-50%); animation: sensorPulse 1.6s ease-in-out infinite; }
    .mobile-sensor:nth-child(5) { top: 60%; left: 20%; animation: sensorPulse 1.9s ease-in-out infinite; }
    .mobile-sensor:nth-child(6) { top: 30%; left: 10%; animation: sensorPulse 2.2s ease-in-out infinite; }

    .mobile-stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .mobile-stat {
        text-align: center;
        padding: 20px 10px;
        background: rgba(229, 199, 56, 0.03);
        border: 1px solid rgba(229, 199, 56, 0.1);
        border-radius: 12px;
    }

    .mobile-stat-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--wfs-yellow);
        margin-bottom: 5px;
    }

    .mobile-stat-label {
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.7);
    }

    @keyframes pulse {
        0%, 100% {
            box-shadow: 0 0 30px var(--wfs-yellow);
        }
        50% {
            box-shadow: 0 0 50px var(--wfs-yellow);
        }
    }

    @keyframes sensorPulse {
        0%, 100% {
            opacity: 0.6;
            transform: scale(1);
        }
        50% {
            opacity: 1;
            transform: scale(1.3);
        }
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .mobile-stats-grid {
        grid-template-columns: 1fr;
    }
}
