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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

/* Time Control Panel */
#time-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 250px;
    max-width: 300px;
}

#time-panel h3 {
    font-size: 1rem;
    color: #1976d2;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.time-section {
    margin-bottom: 12px;
}

.time-section label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.time-section select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.time-slider-container {
    padding: 0 4px;
}

#time-slider {
    width: 100%;
    margin: 8px 0;
    cursor: pointer;
}

.time-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #888;
}

.animation-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.animation-controls button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #1976d2;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.animation-controls button:hover:not(:disabled) {
    background: #1565c0;
}

.animation-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.animation-controls label {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.time-stats {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

#time-display {
    color: #1976d2;
}

/* Info Panel */
#info-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 220px;
    max-width: 280px;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.logo {
    max-width: 180px;
    height: auto;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-secondary {
    display: block;
    margin: 10px auto 0;
    max-width: 150px;
}

#info-panel h2 {
    font-size: 1.2rem;
    color: #d32f2f;
    margin-bottom: 4px;
}

#info-panel h3 {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-section {
    margin-bottom: 12px;
}

.info-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

#fire-count {
    font-size: 1.5rem;
    color: #d32f2f;
}

.legend {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.legend-title {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.legend-gradient {
    height: 12px;
    background: linear-gradient(to right,
        #0000ff,
        #00ffff,
        #00ff00,
        #ffff00,
        #ff0000
    );
    border-radius: 4px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
}

/* Time-based legend */
.time-legend {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.time-legend-items {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.8;
}

.time-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.time-dot.recent {
    background: #d32f2f;
    box-shadow: 0 0 4px rgba(211, 47, 47, 0.5);
}

.time-dot.medium {
    background: #ff9800;
}

.time-dot.old {
    background: #9e9e9e;
}

.data-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.data-info summary {
    font-size: 0.8rem;
    color: #1976d2;
    cursor: pointer;
    font-weight: 500;
}

.data-info summary:hover {
    text-decoration: underline;
}

.data-info details[open] summary {
    margin-bottom: 10px;
}

.data-info p {
    font-size: 0.75rem;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.data-info p:last-child {
    margin-bottom: 0;
}

.status-message {
    margin-top: 15px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: none;
}

.status-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
}

.status-message.warning {
    display: block;
    background: #fff3e0;
    color: #e65100;
}

.status-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    text-align: center;
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d32f2f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fire marker popup styling */
.leaflet-popup-content {
    font-size: 0.9rem;
}

.fire-popup {
    line-height: 1.5;
}

.fire-popup strong {
    color: #d32f2f;
}

/* Responsive design */
@media (max-width: 768px) {
    #info-panel {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    #info-panel h2 {
        font-size: 1rem;
    }

    .info-section {
        display: inline-block;
        margin-right: 15px;
    }
}

@media (max-width: 480px) {
    #info-panel {
        padding: 15px;
    }

    .legend {
        display: none;
    }
}

/* Time panel responsive */
@media (max-width: 768px) {
    #time-panel {
        top: auto;
        bottom: 180px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .animation-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #time-panel {
        bottom: 150px;
        padding: 10px;
    }

    .time-legend {
        display: none;
    }
}
