/* Live Threat Map Styles */
.threat-container {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.threat-header {
    text-align: center;
    margin-bottom: 2rem;
}

.threat-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.threat-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.last-updated {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.threat-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 1200px) {
    .threat-content {
        grid-template-columns: 2fr 1fr;
    }
}

.map-container {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.map-header h2 {
    color: var(--text-primary);
}

.map-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-primary);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
}

.world-map {
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

.legend-color.malware {
    background: #ff6b6b;
}

.legend-color.phishing {
    background: #4ecdc4;
}

.legend-color.ransomware {
    background: #ffd93d;
}

.legend-color.ddos {
    background: #6c5ce7;
}

.legend-color.intrusion {
    background: #fd79a8;
}

.stats-panel {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-header h2 {
    color: var(--text-primary);
}

.time-window {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 8px;
}

.stat-content h3 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.stat-trend {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.attack-types, .top-targets {
    font-size: 0.85rem;
}

.attack-type-item, .target-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.attack-type-name, .target-name {
    color: var(--text-primary);
}

.attack-type-count, .target-count {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.recent-attacks {
    margin-top: 1.5rem;
}

.recent-attacks h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.attacks-list {
    max-height: 200px;
    overflow-y: auto;
}

.attack-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.attack-item:last-child {
    border-bottom: none;
}

.attack-info {
    display: flex;
    flex-direction: column;
}

.attack-type {
    font-weight: 500;
    color: var(--text-primary);
}

.attack-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.attack-time {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: right;
}

.threat-info {
    margin-bottom: 3rem;
}

.threat-info h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.protection-tips {
    margin-bottom: 2rem;
}

.protection-tips h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.tips-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.tip {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.tip-number {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.tip p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* D3.js map styles */
.country {
    fill: var(--bg-secondary);
    stroke: var(--border-color);
    stroke-width: 0.5;
}

.attack-line {
    stroke-linecap: round;
    opacity: 0.7;
}

.attack-dot {
    r: 4;
    opacity: 0.8;
}

.attack-label {
    font-size: 10px;
    fill: var(--text-primary);
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.3s;
}

.attack-line:hover + .attack-label,
.attack-dot:hover + .attack-label {
    opacity: 1;
}

/* Animation for attack lines */
@keyframes dash {
    to {
        stroke-dashoffset: 0;
    }
}

.attack-line {
    stroke-dasharray: 5;
    stroke-dashoffset: 100;
    animation: dash 2s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .attack-item {
        grid-template-columns: 1fr;
    }
    
    .attack-time {
        text-align: left;
    }
    
    .world-map {
        height: 300px;
    }
}

/* Theme-specific adjustments */
[data-theme="dark"] .country {
    fill: #2d3748;
    stroke: #4a5568;
}

/* Ensure the map container has proper dimensions */
.world-map {
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

/* Attack animation */
@keyframes dash {
    to {
        stroke-dashoffset: -20;
    }
}

.attack-line {
    stroke-dasharray: 5;
    animation: dash 2s linear infinite;
}

/* Make sure SVG elements are visible */
.country {
    fill: var(--card-bg);
    stroke: var(--border-color);
    stroke-width: 1;
}
/* World map container styles */
.world-map {
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.world-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

#attackCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Responsive adjustments for map */
@media (max-width: 768px) {
    .world-map {
        height: 300px;
    }
}