/**
 * 3D Threat Map Styles
 * Enterprise Scanner - Global Threat Visualization
 */

/* Main container */
.threat-map-wrapper {
    position: relative;
    width: 100%;
    min-height: 600px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#threat-map-3d {
    position: relative;
    width: 100%;
    height: 600px;
    cursor: grab;
}

#threat-map-3d:active {
    cursor: grabbing;
}

/* Controls panel */
.threat-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    min-width: 220px;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.threat-map-controls h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Filter checkboxes */
.filter-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.filter-checkbox span {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* Severity colors */
.severity-critical {
    color: #ef4444;
}

.severity-high {
    color: #f59e0b;
}

.severity-medium {
    color: #fbbf24;
}

.severity-low {
    color: #10b981;
}

/* Control buttons */
.btn-control {
    width: 100%;
    padding: 10px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-control:hover {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.8);
    transform: translateY(-2px);
}

.btn-control:active {
    transform: translateY(0);
}

.btn-control i {
    font-size: 16px;
}

/* Stats panel */
.stats-panel {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

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

.stat-label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.stat-value {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

/* Threat details panel */
.threat-details-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 320px;
    max-width: 400px;
    z-index: 100;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.threat-details-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.threat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
}

.threat-header.severity-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.3));
}

.threat-header.severity-high {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.3));
}

.threat-header.severity-medium {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.3));
}

.threat-header.severity-low {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.3));
}

.threat-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.threat-body {
    padding: 20px;
}

.threat-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.threat-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.threat-field .label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    min-width: 100px;
}

.threat-field .value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    flex: 1;
}

.status-active {
    color: #ef4444;
}

.status-mitigated {
    color: #10b981;
}

/* Threat actions */
.threat-actions {
    padding: 15px 20px 20px;
    display: flex;
    gap: 10px;
}

.btn-action {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-investigate {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn-mitigate {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Loading state */
.threat-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}

.threat-map-loading .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.threat-map-loading p {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Legend */
.threat-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    z-index: 10;
}

.threat-legend h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

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

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.legend-marker.critical {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.legend-marker.high {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.legend-marker.medium {
    background: #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.legend-marker.low {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.legend-label {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .threat-map-wrapper {
        min-height: 400px;
    }

    #threat-map-3d {
        height: 400px;
    }

    .threat-map-controls {
        top: 10px;
        right: 10px;
        padding: 15px;
        min-width: 180px;
        max-height: calc(100% - 20px);
        overflow-y: auto;
    }

    .threat-map-controls h4 {
        font-size: 12px;
    }

    .filter-checkbox span {
        font-size: 12px;
    }

    .btn-control {
        padding: 8px;
        font-size: 12px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 14px;
    }

    .threat-details-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
    }

    .threat-header h3 {
        font-size: 16px;
    }

    .threat-field .label,
    .threat-field .value {
        font-size: 12px;
    }

    .btn-action {
        padding: 10px;
        font-size: 13px;
    }

    .threat-legend {
        bottom: 10px;
        left: 10px;
        padding: 12px;
    }

    .threat-legend h4 {
        font-size: 12px;
    }

    .legend-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #threat-map-3d {
        height: 350px;
    }

    .threat-map-controls {
        font-size: 11px;
    }

    .control-group {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .stats-panel {
        padding: 12px;
    }

    .threat-actions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .threat-details-panel,
    .btn-control,
    .btn-action,
    .close-btn {
        transition: none;
    }

    .threat-map-loading .spinner {
        animation: none;
        border-color: #3b82f6;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .threat-map-controls,
    .threat-details-panel,
    .threat-legend {
        border: 2px solid #fff;
    }

    .btn-control,
    .btn-action {
        border: 2px solid currentColor;
    }
}
