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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 30px;
}

.plot-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 300px; /* Give some default height */
}

#plot1 {
    grid-column: 1 / -1;
}

#plot2 {
    grid-column: 1 / -1;
}

#mapid {
    height: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #333;
}

canvas {
    max-height: 460px;
}

.info-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #ffffff;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.stat-card h4 {
    font-size: 0.9em;
    opacity: 0.8;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.fire-severe { background: #d32f2f; }
.fire-moderate { background: #ff6f00; }
.fire-low { background: #ffa726; }
.drought-severe { background: #8b4513; }
.drought-moderate { background: #d4a574; }
.no-risk { background: #4caf50; }

footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
}

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

.popup-content h4 {
    margin-bottom: 10px;
    color: #333;
}

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

.risk-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.85em;
    margin-top: 5px;
}

.risk-high { background: #ffebee; color: #c62828; }
.risk-medium { background: #fff3e0; color: #e65100; }
.risk-low { background: #e8f5e9; color: #2e7d32; }

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .main-content {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }

    .legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .stat-card .value {
        font-size: 2em;
    }
}