/* locations.css */


.locations-hero {
    height: 50vh !important; /* Shorter hero for utility page */
}

.locations-wrapper {
    background-color: #f8f9fa;
    padding: 3rem 2rem;
}

.locations-container-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    height: 70vh; 
    max-height: 800px; /* Keeps it from getting too tall on large screens */
    min-height: 600px; /* Safety to ensure map isn't squished on tiny screens */
}

/* Sidebar Styling */
.locations-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
    background: #fff;
    height: 100%; /* Strictly lock height */
    overflow: hidden; /* Prevent the sidebar itself from scrolling/expanding */
}

.sidebar-header {
    padding: 2rem;
    background: #00346b;
    color: white;
    flex-shrink: 0; /* Prevent header from shrinking */
        display: none; /* Wanna hide it for now */
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-header p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.locations-list {
    flex: 1;
    overflow-y: auto; /* Only this list is scrollable */
    padding: 1rem;
    scroll-behavior: smooth;
    overflow-x: hidden; /* Strictly prevent horizontal scrolling */
}

/* Scrollbar styling */
.locations-list::-webkit-scrollbar { width: 6px; }
.locations-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

.location-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: #fcfcfc;
    align-items: center; /* Centers the image, text, and button vertically */
}

.location-item:hover, 
.location-item.active {
    background: #f0f7ff;
    border-color: #00346b;
    transform: translateX(5px);
}

.location-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.item-info {
    flex: 1; /* Takes up remaining space, pushing the button to the right */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0; /* Prevents text from forcing parent width */
}

.item-info h3 {
    margin: 0;
    font-size: 1rem;
    color: #00346b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    margin-top: 5px;
    text-transform: uppercase;
}

.badge.available { background: #e1f5fe; color: #0288d1; }
.badge.unavailable { background: #eee; color: #777; }

/* Custom Details Button in List */
.list-details-btn {
    background-color: #00346b;
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 52, 107, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevents text from breaking into two lines */
    flex-shrink: 0;
}

.list-details-btn:hover {
    background-color: #0288d1;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 52, 107, 0.3);
    color: #fff;
}

/* Map Area */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 0; /* Remove radius inside the split container */
}

/* Tablet Adjustments */
@media (max-width: 1104px) {
    
    .locations-container-main {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .locations-sidebar {
        height: 50vh;
        min-height: 400px;
        order: 2;
        padding-top: 5rem;
    }

    .map-wrapper {
        height: 50vh;
        min-height: 360px;
        order: 1;
    }
    .locations-list {
    flex: 1;
    overflow-y: auto; /* Only this list is scrollable */
    padding: 1rem;
    scroll-behavior: smooth;
    overflow-x: hidden; /* Strictly prevent horizontal scrolling */
}
}

/* Mobile Adjustments (Phones) */
@media (max-width: 768px) {
    .locations-list {
        position: relative;
    }
    .locations-wrapper {
        padding: 0;
        padding-top: 0;
    }

.locations-container-main {
        position: relative; 
        display: flex;
        flex-direction: column;
        border-radius: 0; 
        box-shadow: none; 
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
        height: auto;
    }

    .location-item {
        gap: 10px; /* Reduce gap to fit elements better */
        padding: 10px; 
    }

    .location-item img {
        width: 60px; /* Shrink image on mobile */
        height: 60px;
    }

    .item-info h3 {
        font-size: 0.9rem; /* Slightly smaller title */
    }

    .list-details-btn {
        padding: 6px 10px; /* Slim down the button padding */
        font-size: 0.75rem; 
    }
    .map-wrapper {
        position: relative;
        height: 50vh !important; 
        min-height: 50vh !important;
        max-height: 50vh !important;
        /* You might need to tweak this value based on the exact height of your navbar */
        z-index: 10; /* Ensures the map stays on top of the list */
        background-color: #ffffff; /* Prevents the list from showing through transparent gaps */
        
        /* Optional: Adds a nice little shadow under the map so it looks elevated */
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    }
#map {
        width: 100vw !important;
        
        /* Forces the height to be exactly 100% of the screen's width */
        height: 50vh !important; 
        min-height: 50vh !important;
        max-height: 50vh !important;
        
        /* Alternatively, this modern CSS rule guarantees it stays a perfect square */
        aspect-ratio: 1 / 1; 

        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    
    }
    .locations-sidebar {
        padding-top: 0;
    }
    footer {
        display: block;
    }
}


/* --- PREVENT MOBILE LANDSCAPE VIEW (ANIMATED CARTOON EDITION) --- */

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* The bouncy, cartoonish physics for the phone flipping */
@keyframes flipPhone {
    0% { transform: translate(-50%, -50%) rotate(-90deg); }
    40% { transform: translate(-50%, -50%) rotate(0deg); }
    60% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(-90deg); }
}

