:root {
    --bg-color: #fdf6e3;
    --sidebar-bg: #fffbf5;
    --primary-color: #5d4037;
    --secondary-color: #8d6e63;
    --accent-color: #d7ccc8;
    --text-color: #333;
    --sidebar-width: 400px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

/* Sidebar Styles */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: width 0.3s ease, padding 0.3s ease;
    /* Animation */
    flex-shrink: 0;
    /* Prevent crushing */
}

#sidebar.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
}

.header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 20px;
    text-align: center;
    border-bottom: 4px solid var(--secondary-color);
}

.header h1 {
    margin: 0;
    font-family: 'Georgia', serif;
    font-size: 24px;
    letter-spacing: 1px;
}

.header h2 {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: normal;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.content {
    padding: 25px;
}

/* Controls */
.control-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 14px;
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.description {
    background-color: #fff3e0;
    padding: 15px;
    border-left: 4px solid #ffb74d;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 25px;
    border-radius: 2px;
}

button#calculate-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button#calculate-btn:hover {
    background-color: #4e342e;
}

button#calculate-btn:active {
    transform: translateY(1px);
}

/* Status & Results */
.status-box {
    padding: 10px;
    margin-bottom: 15px;
    background: #e0f2f1;
    color: #00695c;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    border: 1px solid #b2dfdb;
    display: none;
}

.status-box.error {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

#results-panel {
    margin-top: 20px;
    border-top: 1px solid var(--accent-color);
    padding-top: 20px;
}

h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.color-box {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.green {
    background: #4caf50;
}

.yellow {
    background: #ffeb3b;
}

#selected-info {
    font-size: 14px;
    line-height: 1.6;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    color: #444;
}

.hidden {
    display: none;
}

/* Map */
#map {
    flex-grow: 1;
    height: 100vh;
    background-color: #e5e5e5;
}

/* Custom Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    padding: 0;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 200px !important;
}

.custom-popup {
    font-family: 'Segoe UI', sans-serif;
}

.popup-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 15px;
}

.popup-row {
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    font-size: 14px;
}

.popup-row .icon {
    font-size: 16px;
    margin-right: 10px;
}

.popup-row .value {
    font-weight: 600;
    color: var(--primary-color);
}

.popup-note {
    padding: 8px 15px;
    font-size: 11px;
    color: #888;
    text-align: right;
    background: #fafafa;
}

/* Close button fix */
.leaflet-container a.leaflet-popup-close-button {
    color: #fff;
    top: 5px;
    right: 5px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #eee;
    background: transparent;
}