:root {
    --primary-color: #4CAF50;
    --background-color: #ffffff;
    --text-color: #333333;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --border-color: #ddd;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark-mode {
    --primary-color: #81C784;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --panel-bg: rgba(30, 30, 30, 0.9);
    --border-color: #444;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.controls-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    right: auto;
    background: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 300px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.controls-panel h3 {
    margin-top: 0;
    font-size: 1.1em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

select,
button {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
}

button:hover {
    background-color: var(--border-color);
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.toggle-switch input {
    margin-left: 10px;
}

/* MapLibre specific overrides */
body.dark-mode .maplibregl-canvas-container {
    background-color: #111;
}

/* Ensure controls don't overlap with our custom panel */
.maplibregl-ctrl-top-left {
    top: 80px;
    /* Push down standard controls if they are on left */
}

/* Geocoder custom styling if needed */
.maplibregl-ctrl-geocoder {
    min-width: 200px;
}

.measurement-panel {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 300px;
    backdrop-filter: blur(5px);
}

.measurement-panel h4 {
    margin: 0 0 10px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

#measure-output p {
    margin: 5px 0;
    font-size: 0.9em;
}