:root {
    --primary-color: #ff8c00;
    --bg-dark: #0f172a;
    --panel-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-light: #f8fafc;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    background-color: var(--bg-dark);
}

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

/* Panels Common */
.info-panel, .list-panel {
    position: absolute;
    right: 10px;
    z-index: 1000;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-light);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

/* Info Panel */
.info-panel {
    top: 220px; 
    padding: 15px 20px;
    min-width: 250px;
    pointer-events: none;
}

.info-panel h4, .list-panel h4 {
    margin-bottom: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
}

.info-panel .value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* List Panel */
.list-panel {
    top: 320px;
    width: 250px;
    max-height: 50vh; 
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.list-container {
    overflow-y: auto;
    margin-top: 5px;
}

.list-container::-webkit-scrollbar {
    width: 6px;
}

.list-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

#cvegeo-list {
    list-style: none;
}

#cvegeo-list li {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    border: 1px solid transparent;
}

#cvegeo-list li:hover {
    background: rgba(255, 140, 0, 0.2);
    border-color: var(--primary-color);
}

#cvegeo-list li.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Leaflet Overrides */
.leaflet-control-layers {
    border-radius: 12px !important;
    border: 1px solid var(--glass-border) !important;
    background: var(--panel-bg) !important;
    color: white !important;
    padding: 10px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-bar a {
    background: var(--panel-bg) !important;
    color: white !important;
    border: 1px solid var(--glass-border) !important;
}

.leaflet-bar a:hover {
    background: var(--primary-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hide info panel by default on small screens or move it to top center */
    .info-panel {
        top: 10px;
        left: 10px;
        right: 70px; /* Space for layer control */
        min-width: 0;
        padding: 10px 15px;
        border-radius: 8px;
    }

    .info-panel .value {
        font-size: 0.9rem;
    }

    /* List Panel as a bottom drawer on mobile */
    .list-panel {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-height: 35vh;
        border-radius: 16px;
        padding: 12px;
    }

    .list-panel h4 {
        text-align: center;
        padding-bottom: 5px;
        border-bottom: 1px solid var(--glass-border);
    }

    /* Adjust leaflet controls for mobile touch */
    .leaflet-control-zoom {
        display: none; /* Often intrusive on small maps, can use pinch to zoom */
    }

    .leaflet-control-layers {
        margin-right: 10px !important;
        margin-top: 10px !important;
    }
}

@media (max-width: 480px) {
    .info-panel {
        font-size: 0.8rem;
    }
    
    .list-panel {
        max-height: 30vh;
    }
}
