.main{
    flex-wrap: nowrap;
    height: 100vh;
}

.logo{
    height:75px;
    /* width: 75px; */
}

.side-bar{
    height: 100vh;
    width: 400px;
    display: flex;
    flex-direction: column;
}

.side-bar .sidebar-content {
    flex: 1; /* Takes remaining space after header */
    display: flex;
    flex-direction: column;
    min-height: 0; /* ✅ CRITICAL: Allows flex children to shrink */
}


.side-bar .half {
    flex: 1; /* Each takes exactly 50% */
    overflow-y: auto; /* ✅ Vertical scroll only */
    min-height: 0; /* ✅ CRITICAL: Allows content to scroll */
    max-height: 50%; /* ✅ Ensures never exceeds 50% */
}   


.display-area{
    flex:1;
}


/* MAPLIBRE */
.display-area{
     display: flex;
}

#map{
    flex:1;
}




/* .category-header{
    background-color: rgb(38, 38, 66);
} */

.sidebar-content.expanded .half:first-child {
    display: none;
}

.sidebar-content.expanded .form-part.half {
    flex: 2;
    max-height: 100%;
}

/* Hide MapLibre attribution */
.maplibregl-ctrl-attrib {
    display: none !important;
}

.expand-retract {
  background: rgb(145, 145, 145);
  width: 30px;
  height: 30px;
  border-radius: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(0, 0, 0);
  flex-shrink: 0; /* Prevents the dot from shrinking */
}

.expand-retract:hover{
    cursor: cell;
}

.header-hilight{

    padding: 0.375rem 0.75rem;
    background-color: rgba(115, 133, 184, 0.384);
    /* border: 10px rgb(255, 255, 255) solid; */
   
    margin: 1px;
    border-radius: 10px;
}

.selected-category{
    /* background-color: rgba(241, 27, 27, 0.384); */
    background-color: rgba(59, 72, 107, 0.885);
    color: white;
}

.btn-hover:hover{


    background-color: rgb(62, 62, 62);
    color: white;
    cursor: pointer;
    
}

.toggle-icon{
    width: 25px;
    height: 25px;
    
}

.toggle_sidebar {
        position: fixed;
        top: 25px;
        right: 25px;
        z-index: 1001;
        background: #30333470;
        color: white;
        border: none;
        border-radius: 10px;
        width: 100px;
        height: 40px;
        font-size:12px;
        cursor: pointer;
        transition: transform 0.2s ease;
        align-items: center;
        display: flex;
        justify-content: center;
    }

.search_bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 300px;
}

.search_field {
    background-color: rgba(255, 255, 255, 0.494);
    border-bottom-right-radius:0px;
    border-top-right-radius:0px;
}

.search_field_button {
    background-color: rgba(243, 66, 66, 0.494);
    border-bottom-left-radius:0px;
    border-top-left-radius:0px;
}

.search_result{
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.title-select{
    padding:5px;
    width:100%;
    cursor: pointer;
}

.title-select.selected{
    background-color: rgba(110, 112, 116, 0.374);
}

.title-select:hover{
    background-color: rgba(110, 112, 116, 0.374);
    width:100%;
}



/*--------------------------------------------------*/

/* Add this to your main_styles.css file */

/* Mobile Styles - Add at the bottom of your CSS file */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
        position: relative;
        height: 100vh;
        overflow: hidden;
    }
    
    /* Map takes full screen on mobile */
    .display-area {
        flex: 1;
        width: 100%;
        height: 100vh;
    }
    
    #map {
        width: 100%;
        height: 100%;
    }
    
    /* Sidebar becomes bottom sheet */
    .side-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        height: 85vh; /* Takes 60% of screen height */
        max-height: 85vh; /* Never more than 80% */
        min-height: 200px; /* Minimum height */
        transform: translateY(calc(100% - 60px)); /* Hidden by default, showing only header */
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.9);
        border-top: 2px solid #ccc;
        border-radius: 15px 15px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
        flex-direction: column;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* When sidebar is expanded */
    .side-bar.expanded {
        transform: translateY(0);
    }
    
    /* Sidebar header on mobile - make it a drag handle */
    .side-bar > div:first-child {
        flex-shrink: 0;
        height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        position: relative;
    }
    
    /* Add drag indicator */
    .side-bar > div:first-child::after {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
    
    /* Logo adjustments for mobile */
    .side-bar .logo {
        height: 40px;
    }
    
    .side-bar h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    /* Sidebar content adjustments */
    .sidebar-content {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    
    /* Make the halves stack better on mobile */
    .side-bar .half {
        max-height: none;
        flex: 1;
    }
    
    /* When form is expanded, adjust heights */
    .sidebar-content.expanded .half:first-child {
        display: none;
    }
    
    .sidebar-content.expanded .form-part.half {
        flex: 1;
        max-height: none;
    }
    
    /* Add toggle button for mobile */
    .mobile-sidebar-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        background: #3FB1CE;
        color: white;
        border: none;
        border-radius: 50%;
        width: 60px;
        height: 60px;
        font-size: 24px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .mobile-sidebar-toggle:hover {
        transform: scale(1.1);
    }
    
    .mobile-sidebar-toggle.hidden {
        display: none;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .side-bar {
        width: 300px; /* Slightly narrower on tablets */
    }
}

/* Small phone adjustments */
@media (max-width: 480px) {
    .side-bar {
        height: 85vh;
        transform: translateY(calc(100% - 50px));
    }
    
    .side-bar > div:first-child {
        height: 50px;
        padding: 8px 15px;
    }
    
    .side-bar .logo {
        height: 35px;
    }
    
    .side-bar h1 {
        font-size: 1rem;
    }
    
    .mobile-sidebar-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}