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

:root {
    --primary: #0a0e1a;
    --secondary: #1a1d29;
    --accent: #00d9ff;
    --danger: #ff3366;
    --warning: #ffaa00;
    --success: #00ff88;
    --text: #ffffff;
    --text-dim: #8892b0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

.globe-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Header */
.globe-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: translateX(-5px);
}

.globe-header h1 {
    font-size: 1.8em;
    font-weight: 700;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 136, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--success);
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

/* Stats Bar */
.stats-bar {
    position: absolute;
    top: 90px;
    left: 30px;
    right: 30px;
    display: flex;
    gap: 20px;
    z-index: 50;
}

.stat-item {
    background: rgba(26, 29, 41, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-dim);
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent);
}

/* Globe Canvas */
.globe-viz {
    width: 100%;
    height: 100%;
}

/* Controls Panel */
.controls-panel {
    position: absolute;
    top: 180px;
    right: 30px;
    width: 250px;
    background: rgba(26, 29, 41, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 50;
}

.controls-panel h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--accent);
}

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

.control-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
}

.control-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.control-group select {
    width: 100%;
    padding: 8px;
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9em;
    cursor: pointer;
}

.btn {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: #00b8d4;
    transform: translateY(-2px);
}

/* Legend */
.legend {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(26, 29, 41, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 50;
}

.legend h3 {
    margin-bottom: 15px;
    font-size: 1em;
    color: var(--accent);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85em;
}

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

.legend-dot.critical { background: #ff0040; box-shadow: 0 0 10px #ff0040; }
.legend-dot.high { background: #ff6600; box-shadow: 0 0 10px #ff6600; }
.legend-dot.medium { background: #ffaa00; box-shadow: 0 0 10px #ffaa00; }
.legend-dot.low { background: #00aaff; box-shadow: 0 0 10px #00aaff; }
.legend-dot.minimal { background: #00ff88; box-shadow: 0 0 10px #00ff88; }

/* Info Panel */
.info-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-height: 80vh;
    background: rgba(26, 29, 41, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 20px;
    z-index: 200;
    overflow-y: auto;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.info-header h3 {
    color: var(--accent);
    font-size: 1.3em;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 2em;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(136, 146, 176, 0.2);
}

.info-label {
    color: var(--text-dim);
    font-size: 0.9em;
}

.info-value {
    font-weight: 600;
}

/* Activity Feed */
.activity-feed {
    position: absolute;
    top: 180px;
    left: 30px;
    width: 300px;
    max-height: 400px;
    background: rgba(26, 29, 41, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 50;
    overflow-y: auto;
}

.activity-feed h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--accent);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    padding: 10px;
    background: rgba(10, 14, 26, 0.6);
    border-left: 3px solid var(--danger);
    border-radius: 6px;
    font-size: 0.85em;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-ip {
    font-weight: 700;
    color: var(--accent);
}

.activity-country {
    color: var(--text-dim);
    font-size: 0.9em;
}

.activity-time {
    color: var(--text-dim);
    font-size: 0.8em;
    margin-top: 5px;
}

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

::-webkit-scrollbar-track {
    background: rgba(10, 14, 26, 0.5);
}

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

/* Responsive */
@media (max-width: 1024px) {
    .stats-bar {
        flex-wrap: wrap;
    }
    
    .controls-panel,
    .activity-feed {
        width: 200px;
    }
    
    .info-panel {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .stats-bar,
    .controls-panel,
    .activity-feed,
    .legend {
        display: none;
    }
    
    .globe-header {
        padding: 15px;
    }
    
    .globe-header h1 {
        font-size: 1.2em;
    }
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 217, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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