body { 
    margin: 0; 
    padding: 0; 
    font-family: Arial, sans-serif;
}

#map { 
    width: 100%; 
    height: 100vh; 
}

/* Legend Styles */
.info {
    padding: 10px;
    background: white;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.legend-item span {
    font-size: 12px;
    color: #555;
}

.popup-content {
    min-width: 200px;
}

.popup-content h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.popup-content p {
    margin: 5px 0;
    font-size: 0.9em;
}

.history-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

.history-btn:hover {
    background-color: #45a049;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover { 
    color: black; 
}

#timeframeSelect {
    padding: 8px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.sensor-info {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.sensor-info span {
    font-size: 0.9em;
    color: #555;
}

/* Custom marker styles */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Status color classes for popup */
.status-green {
    color: #4CAF50;
    font-weight: bold;
}

.status-yellow {
    color: #FFC107;
    font-weight: bold;
}

.status-red {
    color: #F44336;
    font-weight: bold;
}

.status-black {
    color: #000000;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .info {
        max-width: 150px;
    }
    
    .info h4 {
        font-size: 12px;
    }
    
    .legend-item span {
        font-size: 10px;
    }
}

/* Download button styles */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.download-buttons {
    display: flex;
    gap: 8px;
}

.download-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: #0b7dda;
}

/* Data summary styles */
.data-summary {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
}

.data-summary span {
    font-weight: 500;
}

/* Responsive design for controls */
@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .download-buttons {
        justify-content: center;
    }
    
    .data-summary {
        flex-direction: column;
        gap: 5px;
    }
}

/* Modal content adjustments */
.modal-content {
    max-width: 95%;
}

#timeframeSelect {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    min-width: 150px;
}

/* Animation for status changes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.status-updating {
    animation: pulse 1s ease-in-out;
}
