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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #2c5282;
}

h1 {
    font-size: 2.5rem;
    color: #2c5282;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 30px;
}

.map-container {
    position: relative;
    background: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#map {
    height: 600px;
    width: 100%;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.btn {
    background: #2c5282;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: #2a4365;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sidebar {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    overflow-y: auto;
}

.control-panel h3 {
    font-size: 1.2rem;
    color: #2c5282;
    margin-bottom: 15px;
    font-weight: 600;
}

.scenario-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.scenario-btn {
    background: white;
    border: 2px solid #cbd5e0;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    color: #4a5568;
}

.scenario-btn:hover {
    border-color: #2c5282;
    background: #edf2f7;
}

.scenario-btn.active {
    background: #2c5282;
    color: white;
    border-color: #2c5282;
}

.disaster-slider-container {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #718096;
    margin-bottom: 10px;
}

.disaster-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #48bb78, #f6ad55, #fc8181);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 15px;
}

.disaster-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2c5282;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.disaster-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2c5282;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: none;
}

.weather-effects {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.effect-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
}

.effect-item span:first-child {
    color: #4a5568;
}

.effect-item span:last-child {
    font-weight: 600;
    color: #2c5282;
}

.metrics-panel {
    margin-bottom: 25px;
}

.metric-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #2c5282;
}

.metric-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c5282;
}

.node-legend,
.comm-legend {
    margin-bottom: 25px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
}

.node-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-icon.type-a {
    background: #48bb78;
    border: 3px solid #38a169;
}

.node-icon.type-b {
    background: #ed8936;
    border: 3px solid #dd6b20;
}

.node-icon.type-c {
    background: #4299e1;
    border: 3px solid #3182ce;
}

.legend-text {
    font-size: 13px;
}

.legend-text strong {
    color: #2c5282;
}

.comm-icon {
    width: 40px;
    height: 4px;
    flex-shrink: 0;
}

.comm-icon.cbc {
    background: repeating-linear-gradient(
        90deg,
        #9f7aea,
        #9f7aea 5px,
        transparent 5px,
        transparent 10px
    );
}

.comm-icon.aprs {
    background: #ed8936;
    height: 3px;
}

.comm-icon.wifi {
    background: radial-gradient(circle, #4299e1 0%, transparent 70%);
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.comm-icon.bottleneck {
    background: #fc8181;
    height: 4px;
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.signal-dashboard {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.signal-dashboard h3 {
    font-size: 1.2rem;
    color: #2c5282;
    margin-bottom: 20px;
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.signal-chart {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.signal-chart h4 {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: center;
}

canvas {
    display: block;
    margin: 0 auto;
}

.leaflet-popup-content {
    font-family: inherit;
}

.popup-content h4 {
    color: #2c5282;
    margin-bottom: 8px;
}

.popup-content p {
    margin: 4px 0;
    font-size: 13px;
}

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        max-height: none;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.pulse-wave {
    animation: pulse 2s ease-out infinite;
}
