/*insert style here*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
}

#map-container {
    position: relative;
    height: 100vh;
    width: 100vw;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

#control-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

#narrative-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 8px;
    z-index: 1000;
}

#narrative-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

#narrative-timestamp {
    font-weight: bold;
    color: #2196F3;
    font-size: 14px;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
    text-align: center;
}

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

.control-group h4 {
    color: #d32f2f;
    margin-bottom: 10px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}

#time-slider {
    width: 100%;
    margin: 5px 0;
    height: 8px;
    border-radius: 4px;
    outline: none;
    background: linear-gradient(to right, #4caf50, #ffeb3b, #f44336);
}

.button-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    flex: 1;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-danger {
    background: #d32f2f;
    color: white;
}

.btn-warning {
    background: #FF9800;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn:hover {
    opacity: 0.8;
}

.zoom-info {
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

#zoom-level {
    font-weight: bold;
}

#layer-info {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.risk-legend {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
}

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

.legend-color {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
}

.time-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    gap: 10px;
}

.animation-section {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #2196F3;
    margin-top: 10px;
}

.animation-controls {
    margin-top: 10px;
}

.speed-controls {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.speed-controls button {
    flex: 1;
    padding: 4px 8px;
    font-size: 10px;
}

#speed-display {
    display: block;
    margin-top: 5px;
    text-align: center;
}

/* Additional styles for map features */
.straight-evacuation-route {
    stroke-dasharray: none !important;
    stroke-linecap: round;
}

.evacuation-route {
    stroke-dasharray: none !important;
    stroke-linecap: round;
}

.route-start-marker:hover,
.route-end-marker:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.population-center-icon,
.weather-station-icon,
.evacuation-center-icon {
    transition: transform 0.2s ease;
}

.population-center-icon:hover,
.weather-station-icon:hover,
.evacuation-center-icon:hover {
    transform: scale(1.1);
}

.community-label {
    pointer-events: none;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Community risk marker animations */
.community-risk-marker {
    transition: all 0.3s ease;
}

.community-risk-marker:hover {
    transform: scale(1.1);
}

/* Community marker pulse animation for extreme risk */
.community-risk-marker {
    animation: none; /* Default: no animation */
}

/* Extreme risk communities get pulsing animation */
.extreme-risk-pulse {
    animation: pulse 1.5s infinite !important;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    #control-panel {
        width: calc(100vw - 20px);
        top: 10px;
        right: 10px;
        left: 10px;
        max-height: 300px;
    }
    
    #narrative-panel {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .speed-controls {
        flex-direction: column;
        gap: 3px;
    }
    
    .speed-controls button {
        font-size: 9px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    #control-panel {
        font-size: 12px;
        padding: 15px;
    }
    
    .control-group h4 {
        font-size: 14px;
    }
    
    .btn {
        font-size: 10px;
        padding: 6px 10px;
    }
    
    #narrative-text {
        font-size: 12px;
    }
    
    #narrative-timestamp {
        font-size: 10px;
    }
}

/* Animation for layer toggles */
.control-group label {
    transition: background-color 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.control-group label:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

/* Styling for checkboxes */
.control-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 12px;
}

/* Add this to your style.css file: */

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

.alert-marker {
    animation: pulse 1.5s infinite;
}

/* Enhanced route marker styles */
.route-start-marker,
.route-end-marker {
    transition: transform 0.2s ease;
}

.route-start-marker:hover,
.route-end-marker:hover {
    transform: scale(1.1);
}

/* Fire pulsing animations */
.fire-pulse-extreme {
    animation: pulse-extreme 1.5s infinite;
}

.fire-pulse-high {
    animation: pulse-high 2s infinite;
}

@keyframes pulse-extreme {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

@keyframes pulse-high {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
}

/* Alert marker pulse animation */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Moving evacuation zone animations */
.pulse-border {
    animation: pulse-border 2s infinite;
}

.pulse-urgent {
    animation: pulse-urgent 1s infinite;
}

.fire-buffer-zone {
    transition: all 0.5s ease;
}

@keyframes pulse-border {
    0% {
        stroke-width: 3px;
        opacity: 0.8;
    }
    50% {
        stroke-width: 5px;
        opacity: 1;
    }
    100% {
        stroke-width: 3px;
        opacity: 0.8;
    }
}

@keyframes pulse-urgent {
    0% {
        stroke-width: 4px;
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        stroke-width: 6px;
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        stroke-width: 4px;
        opacity: 0.7;
        transform: scale(1);
    }
}

