﻿/* Responsive layout for map + marker list
   - Desktop/tablet: map left, list right (side-by-side)
   - Mobile: map occupies top portion, list occupies bottom (scrollable)
*/

.map-index-wrap {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    /* Account for navbar (~75px) + footer (~60px) + padding */
    height: calc(100vh - 160px);
    max-height: calc(100vh - 160px);
}

/* Default (desktop) */
.map-panel {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
}

.list-panel {
    width: 360px;
    max-width: 40%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 2px 6px var(--shadow-soft);
}

/* Theme overrides for filter card */
.list-panel .bg-light {
    background-color: var(--color-btn-bg) !important;
}

/* Filter section */
.filter-section {
    flex-shrink: 0;
}

.city-search button {
    white-space: nowrap;
}

.filter-panel {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.equipment-filters {
    max-height: 300px;
    overflow-y: auto;
}

.equipment-filter-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
}

.equipment-filter-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.equipment-filter-item label {
    cursor: pointer;
    margin-bottom: 0;
    flex-grow: 1;
    user-select: none;
}

.equipment-count {
    color: var(--color-muted);
    font-size: 0.85rem;
}

/* Markers list container */
#markersList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* marker box */
.marker-box {
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.65rem;
    margin-bottom: 0.65rem;
    background: var(--color-white);
    cursor: pointer;
    transition: box-shadow .12s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.marker-box:hover {
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.marker-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.3;
}

.marker-city {
    margin-top: 0.25rem;
    color: var(--color-muted);
    font-size: 0.825rem;
    line-height: 1.3;
}

/* Mobile / small screens: stack vertically */
@media (max-width: 576px) {
    .map-index-wrap {
        flex-direction: column;
        padding-left: 0;
        padding-right: 0;
        gap: 0.5rem;
        height: calc(100vh - 140px);
        max-height: calc(100vh - 140px);
    }

    .map-panel {
        height: 35vh;
        min-height: 200px;
        max-height: 35vh;
        border-radius: 12px;
    }

    .list-panel {
        height: calc(65vh - 140px - 0.5rem);
        flex: 1;
        max-width: 100%;
        width: 100%;
        border-radius: 12px;
    }

    /* Make marker boxes more compact for mobile */
    .marker-box {
        padding: 0.7rem;
        margin-bottom: 0.5rem;
        touch-action: manipulation;
    }

    .marker-title {
        font-size: 0.9rem;
    }

    .marker-city {
        font-size: 0.8rem;
    }
}

/* Small tablets */
@media (min-width: 577px) and (max-width: 767.98px) {
    .map-index-wrap {
        flex-direction: column;
        padding-left: 5px;
        padding-right: 5px;
        gap: 0.75rem;
        height: calc(100vh - 140px);
    }

    .map-panel {
        height: 40vh;
        min-height: 240px;
        max-height: 40vh;
    }

    .list-panel {
        flex: 1;
        max-width: 100%;
        width: 100%;
    }
}

/* Medium screens */
@media (min-width: 768px) and (max-width: 991.98px) {
    .map-index-wrap {
        height: calc(100vh - 145px);
    }

    .list-panel {
        width: 300px;
        max-width: 35%;
    }
}

/* Large screens - optimize space usage */
@media (min-width: 992px) {
    .map-index-wrap {
        height: calc(100vh - 145px);
    }

    .marker-box {
        padding: 0.7rem;
        margin-bottom: 0.7rem;
    }
}