/* ============================================
   GEO MAP LAYOUT
   ============================================ */

/* Main wrapper */
.geo-map-wrapper {
    display: block; /* Change from flex to block */
    height: 100%;
    width: 100%;
    position: relative; /* Keep this for absolute positioning of side panel */
    margin: 0;
}

/* Map container - now fills entire wrapper */
.geo-map-container {
    height: 100%;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 500px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: #EFF6FF !important;
}

.geo-map-container:focus {
    outline: none !important;
    border: none !important;
}

/* Search container */
.geo-search-container {
    position: absolute;
    top: 10px;
    left: 60px;
    z-index: 1000;
    width: 300px;
}

/* Side panel */
.geo-side-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 0;
    height: auto; /* Change to auto */
    max-height: 100%; /* Don't exceed parent height */
    background-color: transparent;
    border-left: none;
    overflow: hidden;
    transition: width 0.3s ease, border-left 0.3s ease, background-color 0.3s ease;
    box-shadow: none;
    z-index: 1000;
}

/* Side panel when open */
.geo-side-panel.open {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: auto; /* Allow scrolling when open */
}

/* Leaflet chart container */
.leaflet-chart-container {
    border: 1px solid #d1d5db;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background-color: #F0F9FF;
}

/* Leaflet chart - fills container */
.leaflet-chart {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Leaflet container overrides */
.leaflet-container {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.leaflet-container:focus {
    outline: none !important;
    box-shadow: none !important;
}

.leaflet-map-pane {
    margin: 0 !important;
    padding: 0 !important;
}

.leaflet-tile-pane {
    opacity: 0 !important;
}

/* Map container no spacing */
#map-container {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #EFF6FF !important; /* Add this */
}

/* Tooltip */
.custom-map-tooltip {
    background: #F8F8FF !important;
    border-radius: 6px !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    padding: 0 !important;
    font-family: 'Inter', sans-serif !important;
    color: #222 !important;
    font-size: 11px !important;
    width: 220px !important;
    opacity: 1 !important;
    transition: opacity 0.2s ease !important;
}

.custom-map-tooltip::before {
    display: none !important; /* Remove default Leaflet tooltip arrow */
}

.leaflet-tooltip-pane {
    z-index: 9999 !important;
}


/* ============================================
   REGION DETAILS SIDE PANEL
   ============================================ */

.region-details-content {
    padding: 0;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    flex-direction: column;
    gap: 16px;
}

.close-panel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 0;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent it from shrinking */
}

.close-panel-btn:hover {
    color: #000;
}

.panel-header-block {
    background-color: #f5f5f5; /* Light gray from the example */
    padding: 16px 16px 8px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header {
    margin-bottom: 8px;
}



.mini-chart-container {
    margin-top: 20px;
    padding-top: 20px;
}

#region-mini-chart {
    display: block;
    margin: 0 auto;
}

.region-name {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin: 0;
    letter-spacing: -0.5px;
}


.stat-badge {
    font-size: 12px;
    color: #9F9FA9;
    margin-top: 4px;
    font-weight: 400;
}

.panel-body-content {
    padding: 8px 16px;
    margin-top: 12px;
    background: white;
    flex-grow: 1;
}

.detail-section {
    margin-bottom: 24px;
    border-radius: 8px;
}

.detail-section-bordered {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.detail-label {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value-hero-section {
    margin-bottom: 10px;
}

.value-display {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 16px;
}

.unit-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.chart-wrapper {
    margin-top: 8px;
}

.chart-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.main-number {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    line-height: 1;
}

.unit-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}


.detail-value {
    font-size: 12px;
    font-weight: 400;
    color: #374151;
}

.detail-value-large {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}


/* ============================================
   REGION SEARCH BOX
   ============================================ */

.region-search-input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.region-search-input:focus {
    border-color: #2984D1;
    box-shadow: 0 2px 12px rgba(41, 132, 209, 0.2);
}

.region-search-input::placeholder {
    color: #9ca3af;
}

/* Search Results Dropdown */
.region-search-results {
    margin-top: 4px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #F0F9FF;
}

.search-result-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.search-result-code {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #6b7280;
}

.search-no-results {
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

/* Scrollbar styling for search results */
.region-search-results::-webkit-scrollbar {
    width: 6px;
}

.region-search-results::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 8px;
}

.region-search-results::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 8px;
}

.region-search-results::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}