/* Cybersecurity Theme - Dark Mode */
:root {
    --primary-color: #00ff88;
    --secondary-color: #0088ff;
    --danger-color: #ff4444;
    --warning-color: #ffaa00;
    --info-color: #00aaff;
    --dark-bg: #0a0e17;
    --card-bg: #121a2b;
    --border-color: #1e2a44;
    --text-color: #e0e0ff;
    --text-muted: #8a9bb8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header h1 i {
    font-size: 2.2rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    min-height: 800px;
}

.sidebar {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cards */
.stats-card,
.controls-card,
.threat-list-card,
.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stats-card h3,
.controls-card h3,
.threat-list-card h3,
.chart-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats */
.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

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

.label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Controls */
.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--text-color);
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.filter-group select {
    width: 100%;
    padding: 8px 12px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    margin-top: 5px;
}

#refresh-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#refresh-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Threat List */
#threat-list {
    max-height: 300px;
    overflow-y: auto;
}

.threat-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--info-color);
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

.threat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.threat-item.high {
    border-left-color: var(--danger-color);
}

.threat-item.medium {
    border-left-color: var(--warning-color);
}

.threat-item.low {
    border-left-color: var(--info-color);
}

.threat-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color);
}

.threat-details {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.threat-item.loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    border-left-color: var(--border-color);
}

/* Map */
.map-container {
    position: relative;
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#threat-map {
    height: 500px;
    width: 100%;
    border-radius: 12px;
}

.map-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.map-legend {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.map-legend h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
}

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

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

.dot.high {
    background-color: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
}

.dot.medium {
    background-color: var(--warning-color);
    box-shadow: 0 0 8px var(--warning-color);
}

.dot.low {
    background-color: var(--info-color);
    box-shadow: 0 0 8px var(--info-color);
}

/* Charts */
.charts-row {
    display: flex;
    gap: 20px;
    height: 300px;
}

.chart-card {
    flex: 1;
    height: 100%;
}

.chart-card canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 10px;
}

.github-link {
    margin-top: 15px;
}

.github-link a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.github-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        flex: none;
        width: 100%;
    }
    
    .charts-row {
        flex-direction: column;
        height: auto;
    }
    
    .chart-card {
        height: 250px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    .map-overlay {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 10px;
    }
    
    #threat-map {
        height: 400px;
    }
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}