/* ============================================
   GEOSPATIAL INTERACTIVE MAP STYLES - UPDATED
   ============================================ */

.geospatial-map-page {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
}

/* Header - Keep as is */
.map-page-header {
    background: linear-gradient(135deg, #2c5530 0%, #4a7729 100%);
    color: #f8fff9;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1000;
    flex-shrink: 0; /* Prevent header from shrinking */
}

/* Main Container - UPDATED */
.map-container-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr 350px;
    height: calc(100vh - 140px); /* Fixed height based on header */
    position: relative;
    flex: 1; /* Take remaining space */
    min-height: 0; /* Allow inner scrolling */
}

/* Controls Sidebar - UPDATED */
.map-controls-sidebar {
    background: #2a2a2a;
    border-right: 1px solid #444;
    padding: 1.5rem;
    color: #e8f5e9;
    display: flex;
    flex-direction: column;
    height: 100%; /* Full height of container */
    overflow: hidden; /* Prevent double scrollbars */
}

/* Control Groups Container - NEW */
.filters-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem; /* Space for scrollbar */
    margin-right: -0.5rem; /* Compensate for padding */
}

/* Custom scrollbar for sidebar */
.filters-container::-webkit-scrollbar {
    width: 6px;
}

.filters-container::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

.filters-container::-webkit-scrollbar-thumb {
    background: #6B8E23;
    border-radius: 3px;
}

.filters-container::-webkit-scrollbar-thumb:hover {
    background: #4a7729;
}

/* Control Group - UPDATED */
.control-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #444;
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Action Buttons - UPDATED */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: auto; /* Push to bottom */
    padding-top: 1.5rem;
    border-top: 1px solid #444;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Make sure all content fits */
.filters-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-category {
    margin-bottom: 1.2rem;
    min-height: auto; /* Remove fixed heights */
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: none; /* Remove height restrictions */
}

.tool-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

/* Adjust main map container */
.main-map-container {
    position: relative;
    overflow: hidden;
    height: 100%;
}

#geospatialMap {
    width: 100%;
    height: 100%;
    background: #222;
}

/* Data Panel - UPDATED */
.data-panel {
    background: #2a2a2a;
    border-left: 1px solid #444;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%; /* Full height */
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0; /* Allow scrolling */
}

/* Responsive Design - Ensure it works on all screens */
@media (max-width: 1200px) {
    .map-container-wrapper {
        grid-template-columns: 280px 1fr;
    }
    
    .data-panel {
        position: fixed;
        top: 140px;
        right: 0;
        bottom: 0;
        width: 350px;
        transform: translateX(100%);
        z-index: 1001;
        height: calc(100vh - 140px); /* Full viewport minus header */
    }
    
    .map-controls-sidebar {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .map-container-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: calc(100vh - 140px);
    }
    
    .map-controls-sidebar {
        display: none; /* Will be in mobile menu */
    }
    
    .action-buttons {
        margin-top: 1.5rem;
    }
}

/* Ensure no content gets cut off */
.filter-category label,
.filter-option,
.layer-option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Adjust stats for better fit */
.map-stats-bar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.stat {
    text-align: center;
    min-width: 80px; /* Ensure consistent width */
}

.stat .number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #8FC99F; /* Pastel green dark */
    line-height: 1;
}

.stat .label {
    font-size: 0.85rem;
    color: #B8D8BE; /* Pastel green medium */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.3rem;
}

/* Main Container */
.map-container-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr 350px;
    height: calc(100vh - 140px);
    position: relative;
}

/* Controls Sidebar */
.map-controls-sidebar {
    background: #2a2a2a; /* Dark gray */
    border-right: 1px solid #444;
    padding: 1.5rem;
    overflow-y: auto;
    color: #e8f5e9; /* Pastel green light */
}

.control-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #444;
}

.control-group:last-child {
    border-bottom: none;
}

.control-group h3 {
    color: #B8D8BE; /* Pastel green medium */
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #e8f5e9;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #6B8E23; /* Theme accent green */
    box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.2);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8FC99F; /* Pastel green dark */
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filter Categories */
.filter-category {
    margin-bottom: 1.2rem;
}

.filter-category label {
    display: block;
    color: #B8D8BE; /* Pastel green medium */
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.filter-option:hover {
    color: #B8D8BE; /* Pastel green medium */
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6B8E23; /* Theme accent green */
}

/* Range Slider */
.range-slider {
    padding: 0.5rem 0;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #6B8E23; /* Theme accent green */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #2a2a2a;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: #8FC99F; /* Pastel green dark */
    font-size: 0.85rem;
}

/* Tool Buttons */
.tool-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #B8D8BE; /* Pastel green medium */
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #444;
    border-color: #666;
    color: #e8f5e9; /* Pastel green light */
}

.tool-btn.active {
    background: #4a7729; /* Darker green */
    border-color: #6B8E23; /* Theme accent green */
    color: white;
}

/* Layer Controls */
.layer-controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.layer-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #8FC99F; /* Pastel green dark */
}

.layer-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6B8E23; /* Theme accent green */
}

/* Region Select */
.region-select {
    width: 100%;
    padding: 0.8rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #e8f5e9; /* Pastel green light */
    font-size: 0.9rem;
    cursor: pointer;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1rem;
}

.action-btn {
    padding: 0.8rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #6B8E23, #4a7729); /* Theme greens */
    color: white;
}

.action-btn.secondary {
    background: #444;
    color: #B8D8BE; /* Pastel green medium */
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Map Container */
.main-map-container {
    position: relative;
    overflow: hidden;
}

#geospatialMap {
    width: 100%;
    height: 100%;
    background: #222;
}

/* Map Toolbar */
.map-toolbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(51, 51, 51, 0.9);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 142, 35, 0.3); /* Theme accent green */
}

.map-control {
    width: 40px;
    height: 40px;
    background: rgba(68, 68, 68, 0.8);
    border: 1px solid #555;
    border-radius: 6px;
    color: #B8D8BE; /* Pastel green medium */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-control:hover {
    background: #6B8E23; /* Theme accent green */
    color: white;
    border-color: #4a7729;
    transform: scale(1.05);
}

.toolbar-divider {
    height: 1px;
    background: #555;
    margin: 0.25rem 0;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(51, 51, 51, 0.9);
    border-radius: 8px;
    padding: 1rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 142, 35, 0.3); /* Theme accent green */
    min-width: 200px;
}

.map-legend h4 {
    color: #B8D8BE; /* Pastel green medium */
    margin: 0 0 0.8rem 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: #8FC99F; /* Pastel green dark */
}

/* Data Panel */
.data-panel {
    background: #2a2a2a;
    border-left: 1px solid #444;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.data-panel.active {
    transform: translateX(0);
}

.panel-header {
    padding: 1.2rem;
    background: #333;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    color: #B8D8BE; /* Pastel green medium */
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.count-badge {
    background: #6B8E23; /* Theme accent green */
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.close-panel {
    background: none;
    border: none;
    color: #8FC99F; /* Pastel green dark */
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-panel:hover {
    color: #e8f5e9; /* Pastel green light */
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Study Items */
.study-item {
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.study-item:hover {
    border-color: #6B8E23; /* Theme accent green */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.study-image {
    height: 120px;
    background-size: cover;
    background-position: center;
}

.study-info {
    padding: 1rem;
}

.study-info h4 {
    color: #e8f5e9; /* Pastel green light */
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.study-meta {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.type-badge {
    background: #6B8E23; /* Theme accent green */
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.study-meta .location {
    font-size: 0.8rem;
    color: #8FC99F; /* Pastel green dark */
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.study-info p {
    font-size: 0.85rem;
    color: #B8D8BE; /* Pastel green medium */
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.study-link {
    color: #6B8E23; /* Theme accent green */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.study-link:hover {
    color: #8FC99F; /* Pastel green dark */
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    z-index: 2001;
    border: 1px solid #444;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(51, 51, 51, 0.9);
    border: 1px solid #555;
    color: #B8D8BE; /* Pastel green medium */
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: #6B8E23; /* Theme accent green */
    color: white;
}

.modal-image-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#modalImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-nav {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(51, 51, 51, 0.9);
    border: 1px solid #555;
    border-radius: 6px;
    color: #B8D8BE; /* Pastel green medium */
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #6B8E23; /* Theme accent green */
    border-color: #4a7729;
    color: white;
}

.modal-info {
    width: 300px;
    padding: 2rem;
    overflow-y: auto;
    background: #333;
}

#modalTitle {
    color: #e8f5e9; /* Pastel green light */
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    line-height: 1.3;
}

.modal-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-meta span {
    font-size: 0.9rem;
    color: #8FC99F; /* Pastel green dark */
}

#modalDescription {
    color: #B8D8BE; /* Pastel green medium */
    line-height: 1.6;
    margin-bottom: 2rem;
}

.read-article-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #6B8E23, #4a7729);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.read-article-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 142, 35, 0.3);
}

/* Keep the rest of your CSS as is, just updating color references */
/* ... rest of the CSS remains the same with updated colors ... */