/* Import Font Google: Roboto (Hiện đại, dễ đọc) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #0d47a1; /* Xanh đậm chuyên nghiệp hơn */
    --accent-color: #1976d2;  /* Xanh sáng cho nút/slider */
    --bg-sidebar: #ffffff;
    --text-main: #333333;
    --text-light: #666666;
    --header-height: 70px;
    --sidebar-width: 380px; /* Tăng chiều rộng sidebar một chút */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    margin: 0; padding: 0;
    font-family: 'Roboto', sans-serif; /* Áp dụng font mới */
    overflow: hidden;
    background-color: #f4f4f4;
}

/* --- HEADER --- */
.app-header {
    height: var(--header-height);
    background: linear-gradient(90deg, var(--primary-color) 0%, #1565c0 100%); /* Gradient cho sang trọng */
    color: white;
    display: flex;
    align-items: center;
    padding: 0 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1001;
    position: relative;
}

.brand-area { display: flex; align-items: center; width: 100%; }
.header-logo {
    height: 50px;
    width: auto;
    margin-right: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); /* Làm logo nổi bật */
}

/* Tăng kích thước chữ Header theo yêu cầu */
.project-titles h1 {
    margin: 0;
    font-size: 20px; /* Tăng từ 16px lên 20px */
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.project-titles h2 {
    margin: 4px 0 0 0;
    font-size: 14px; /* Tăng từ 13px lên 14px */
    font-weight: 300;
    opacity: 0.9;
}

/* --- LAYOUT --- */
.app-container {
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid #e0e0e0;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 25px; /* Tăng khoảng cách giữa các mục */
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05); /* Đổ bóng nhẹ sang phải */
}

/* Style cho từng nhóm điều khiển */
.control-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px; /* Tăng size chữ label */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    border-bottom: 2px solid #f0f0f0; /* Gạch chân nhẹ phân cách */
    padding-bottom: 5px;
}
.control-group label i { font-size: 18px; }

/* Custom Dropdown (Select) */
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px; /* Chữ trong ô chọn to hơn */
    font-family: 'Roboto', sans-serif;
    background-color: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
}
.form-control:hover { border-color: var(--accent-color); }
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1); }

/* Custom Range Slider (Đẹp hơn mặc định) */
input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px; width: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 6px;
    cursor: pointer;
    background: #ddd;
    border-radius: 3px;
}

/* Info Box & Legend */
.info-box {
    background: #e3f2fd; /* Nền xanh rất nhạt cho box thông tin */
    padding: 15px;
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.legend-box {
    background: white;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#legend-img {
    max-width: 90%;
    height: auto;
    margin-bottom: 8px;
}
.small-text { font-size: 12px; color: #888; margin-top: 5px; font-style: italic; }

.footer-info {
    margin-top: auto;
    font-size: 12px;
    color: #888;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* --- MAP --- */
#map { flex-grow: 1; height: 100%; background: #eef; position: relative;}

/* Popup Style */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.leaflet-popup-content {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Loading Spinner (Hiệu ứng xoay khi load map) */
.loading-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.8);
    padding: 20px;
    border-radius: 8px;
    z-index: 2000;
    display: none; /* Mặc định ẩn */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    font-size: 14px; color: var(--primary-color); font-weight: 500;
}
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px; height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }