/* KU Parking App - Sprint 1 Styles 
Name: styles.css
Description: A simple stylesheet for customized appearances
of HTML elements.
Programmer's name: K Li, Joshua Welicky, Jenna Luong
Creation Date: 2/8/2026
Revision: 2/15/2026
    -- Added comments: Joshua Welicky
Revision: 3/24/2026
    -- Added buy parking permit button style: Jenna Luong
Revision: 3/28/2026
     -- Added a permit description link style: Evans Chigweshe
Revision: 3/29/2026
     -- Req 15 mobile: filter card, touch targets, map height, no horizontal scroll;
        map-first UI (search, lot picker hides map, fixed permit/buy bar); full-bleed map
        under fixed top chrome + bottom bar (Google Maps–style)
Revision: 4/12/2026
     -- Desktop: 3-row grid shell (100dvh); left #lot-list scroll only; simplified scroll CSS.
Preconditions: No required inputs.
Postconditions: Altered styles for index.html and map.js elements.
Errors/Exceptions: No known errors.
No known side effects.
Invariants: N/A
Faults: None identified.
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    --mobile-keyboard-inset: 0px;
    /* Mobile: --jaypark-mobile-row1-bottom = viewport Y of blue bar bottom (px, from map.js) */
    --jaypark-mobile-row1-bottom: calc(env(safe-area-inset-top, 0px) + 2.85rem);
    --jaypark-row1-row2-gap: 14px;
    --jaypark-mobile-fixed-stack-h: 7.25rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

header {
    background-color: #0051ba;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Controls Panel + filter card shell */
.controls-panel.filter-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2rem;
}

.filter-card__fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2rem;
    flex: 1;
    min-width: 0;
}

.filter-card__secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-left: auto;
}

.controls-panel {
    position: relative;
    background-color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: #333;
}

.control-group select,
.control-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #0051ba;
}

/* Search row (mobile only; hidden on desktop) */
.lot-search-row {
    display: none;
    width: 100%;
}

.lot-search-row input[type="search"] {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-size: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.lot-search-row input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.lot-search-row input[type="search"]:focus {
    outline: none;
    border-color: #0051ba;
    box-shadow: 0 0 0 2px rgba(0, 81, 186, 0.2);
}

/* Fixed bottom bar (mobile only) */
.mobile-bottom-bar {
    display: none;
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Lot list: column flex + scroll inside #lot-list only */
.lot-list-panel {
    width: 300px;
    flex-shrink: 0;
    min-height: 0;
    background-color: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
}

.lot-list-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
    flex-shrink: 0;
}

.lot-list-panel #lot-search-sidebar {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

#lot-list {
    list-style: none;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

.lot-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.lot-item:hover {
    background-color: #f0f0f0;
    border-color: #0051ba;
}

.lot-item.selected {
    background-color: #e3f2fd;
    border-color: #0051ba;
}

.lot-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.lot-type {
    font-size: 0.85rem;
    color: #666;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Details Panel */
.details-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
    max-height: 380px;
    padding: 1.5rem;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.details-panel.hidden {
    transform: translateY(100%);
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.details-header h3 {
    font-size: 1.3rem;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #f0f0f0;
}

.details-content {
    color: #555;
}

.details-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Report button in details panel */
.report-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #0051ba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.report-btn:hover {
    background-color: #003f9a;
}

/* Report modal overlay */
.report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    /* Above .details-panel (1000 desktop / 1200 mobile) */
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity 0.2s ease;
}

.report-modal-overlay.hidden {
    display: none;
}

.report-modal {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: min(420px, calc(100vw - 2rem));
    width: 100%;
    min-width: 0;
    max-height: min(90vh, 100dvh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
}

.report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
}

.report-modal-header h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.report-modal-body {
    padding: 1.25rem;
    min-width: 0;
    overflow-x: hidden;
}

.report-modal-body label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.report-modal-body label:first-of-type {
    margin-top: 0;
}

.report-modal-body textarea,
.report-modal-body input[type="datetime-local"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    margin-top: 0.2rem;
    margin-left: 0;
    margin-right: 0;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
}

.report-modal-body textarea:focus,
.report-modal-body input:focus {
    outline: none;
    border-color: #0051ba;
}

.report-modal-body textarea {
    resize: vertical;
    min-height: 60px;
}

/* WebKit: keep datetime fields from growing wider than Description */
.report-modal-body input[type="datetime-local"]::-webkit-datetime-edit,
.report-modal-body input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
    max-width: 100%;
}

.report-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #222;
}

.report-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.report-cancel-btn {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.report-cancel-btn:hover {
    background-color: #e0e0e0;
}

.report-submit-btn {
    padding: 0.5rem 1rem;
    background-color: #0051ba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.report-submit-btn:hover {
    background-color: #003f9a;
}

.details-content strong {
    color: #333;
}

/* Report modal: hide floating chrome, slide lot details away; avoids overlap (mobile + stacking) */
body.report-modal-active .details-panel:not(.hidden) {
    transform: translateY(100%);
    pointer-events: none;
}

@media (max-width: 1023px) {
    body.report-modal-active .mobile-top-chrome {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.15s ease, visibility 0.15s;
    }
}

/* Wrapper: desktop grid uses display:contents; mobile uses flex column (flowing top stack) */
.mobile-top-chrome {
    display: contents;
}

/* Desktop / wide: unwrap so .controls-panel grid matches original; mobile overridden below */
.mobile-fixed-controls {
    display: contents;
}

/* Desktop: no mobile search row / bottom duplicate bar */
@media (min-width: 1024px) {
    /* 3-row shell: header, controls, main — gives .main-content a real height so #lot-list can scroll */
    .container {
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr);
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .lot-search-row {
        display: none !important;
    }

    .mobile-bottom-bar {
        display: none !important;
    }

    .main-content {
        position: relative;
        min-height: 0;
    }

    .map-container {
        position: relative;
        flex: 1;
        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    #map {
        min-height: 200px;
    }

    .map-container .leaflet-top.leaflet-left {
        top: auto;
        margin-top: inherit;
    }

    .map-container .leaflet-bottom.leaflet-right {
        bottom: auto;
        margin-right: auto;
    }
}

/* Responsive adjustments — Req 15 + map-first mobile (full-bleed map under UI) */
@media (max-width: 1023px) {
    /* Document-flow shell: top chrome + map stack (no fixed overlay gap vs body) */
    .container {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        min-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
        position: relative;
    }

    .mobile-top-chrome {
        display: flex;
        flex-direction: column;
        position: relative;
        flex-shrink: 0;
        width: 100%;
        z-index: 500;
        pointer-events: auto;
        box-shadow: none;
        background: transparent;
    }

    /* Row 2 + 3: fixed below row-1 bottom + explicit gap (map shows in the gap; margin was unreliable) */
    .mobile-fixed-controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        position: fixed;
        left: 0;
        right: 0;
        top: calc(var(--jaypark-mobile-row1-bottom) + var(--jaypark-row1-row2-gap));
        width: 100%;
        max-width: 100vw;
        z-index: 500;
        padding: 0.25rem 0 0.35rem;
        box-sizing: border-box;
        pointer-events: none;
        background: transparent;
    }

    .mobile-fixed-controls > * {
        pointer-events: auto;
    }

    /* Desktop blue header must not appear on phone / narrow tablet */
    header.site-header-desktop {
        display: none !important;
    }

    header {
        padding: 0.45rem 0.75rem;
    }

    header h1 {
        font-size: 1.05rem;
    }

    .lot-search-row {
        display: block;
        padding-left: max(0.65rem, env(safe-area-inset-left));
        padding-right: max(0.65rem, env(safe-area-inset-right));
    }

    .filter-card__secondary--desktop {
        display: none !important;
    }

    /* Horizontal padding only on search + chips; blue bar is full viewport width */
    .controls-panel {
        padding: 0.25rem 0 0.35rem;
        width: 100%;
        max-width: 100%;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        overflow: visible;
    }

    .controls-panel.filter-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        background: transparent !important;
    }

    .filter-card__fields {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.45rem;
        background: transparent !important;
        border: none !important;
        padding: 0 max(0.65rem, env(safe-area-inset-right)) 0 max(0.65rem, env(safe-area-inset-left));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-card__fields::-webkit-scrollbar {
        display: none;
    }

    .filter-card__fields .control-group {
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .filter-card__fields .control-group label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .filter-card__fields .control-group select,
    .filter-card__fields .control-group input[type="time"],
    .filter-card__fields .control-group input[type="date"] {
        width: 100%;
        min-height: 34px;
        font-size: 13px;
        font-weight: 500;
        padding: 0.32rem 0.55rem;
        border: none;
        border-radius: 999px;
        background-color: #fff;
        color: #3c4043;
        box-sizing: border-box;
        box-shadow: 0 1px 3px rgba(60, 64, 67, 0.28);
        -webkit-appearance: none;
        appearance: none;
    }

    .filter-card__fields .control-group select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.45rem center;
        padding-right: 1.35rem;
    }

    .filter-card__fields .control-group input[type="time"],
    .filter-card__fields .control-group input[type="date"] {
        padding-right: 0.4rem;
    }

    .filter-card__fields .control-group input[type="time"]::-webkit-calendar-picker-indicator,
    .filter-card__fields .control-group input[type="date"]::-webkit-calendar-picker-indicator {
        opacity: 0.75;
        cursor: pointer;
    }

    /* Map fills remaining column below flowing top chrome */
    .main-content {
        position: relative;
        flex: 1;
        min-height: 0;
        overflow: hidden;
        z-index: 100;
    }

    .lot-list-panel {
        display: none !important;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 40;
        width: 100%;
        max-width: 100%;
        flex: none;
        min-height: 0;
        border-right: none;
        border-bottom: none;
        padding: 0.5rem 0.75rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        background: #f5f5f7;
    }

    .container.mobile-lot-picker-open .map-container {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Hide permit/date/time chips while searching */
    .container.mobile-lot-picker-open .filter-card__fields {
        display: none !important;
    }

    /* Full-screen lot list; top/bottom padding clears fixed chrome + home indicator + keyboard */
    .container.mobile-lot-picker-open .lot-list-panel {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 40;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: #f5f5f7;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        /* List sits under row 1; rows 2–3 float over map — pad for fixed search + chips (or search-only when chips hidden) */
        padding-top: calc(var(--jaypark-row1-row2-gap) + var(--jaypark-mobile-fixed-stack-h, 7.25rem) + 0.35rem);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--mobile-keyboard-inset, 0px) + 1.25rem);
        overflow: hidden;
        flex: none;
        min-height: 0;
    }

    .container.mobile-lot-picker-open .lot-list-panel h2,
    .container.mobile-lot-picker-open .lot-list-panel #lot-search-sidebar {
        display: none !important;
    }

    .container.mobile-lot-picker-open #lot-list {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        scroll-padding-top: 0.5rem;
        scroll-padding-bottom: 1rem;
    }

    /* Lock page scroll while list is open (list itself still scrolls) */
    html.mobile-lot-picker-active,
    body.mobile-lot-picker-active {
        overflow: hidden;
        height: 100%;
        overscroll-behavior: none;
        touch-action: manipulation;
    }

    .lot-list-panel h2 {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
        flex-shrink: 0;
    }

    .lot-item {
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.45rem;
        min-height: 44px;
    }

    .lot-item.lot-item--hidden {
        display: none;
    }

    .map-container {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        flex: none;
        width: 100%;
        height: 100%;
        min-height: 0;
        z-index: 1;
    }

    #map {
        width: 100%;
        height: 100%;
        min-height: 100%;
    }

    /* Zoom sits below fixed search + chip row (within map area, below row 1) */
    .map-container .leaflet-top.leaflet-left {
        top: calc(var(--jaypark-row1-row2-gap) + var(--jaypark-mobile-fixed-stack-h, 7.25rem) + 10px);
        margin-top: 0;
    }

    .map-container .leaflet-bottom.leaflet-right {
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
        margin-right: 4px;
    }

    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .report-btn {
        min-height: 44px;
        font-size: 16px;
    }

    .report-modal-body textarea,
    .report-modal-body input[type="datetime-local"] {
        font-size: 16px;
        min-height: 44px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .details-content p {
        overflow-wrap: anywhere;
        margin-bottom: 0.35rem;
        line-height: 1.45;
    }

    .details-panel {
        max-height: min(28vh, 200px);
        padding: 0.5rem 0.85rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        z-index: 1200;
    }

    .details-header {
        margin-bottom: 0.3rem;
    }

    .details-header h3 {
        font-size: 1rem;
        line-height: 1.15;
    }

    .details-content p:last-child {
        margin-bottom: 0.25rem;
    }

    .details-panel .report-btn {
        margin-top: 0.45rem;
        padding: 0.45rem 0.85rem;
        min-height: 40px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .report-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .report-cancel-btn,
    .report-submit-btn {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }
}

/* Buy permit button */
.permit-buy-btn {
    padding: 0.5rem 1rem;
    background-color: #0051ba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.permit-buy-btn:hover {
    background-color: #003f9a;
}

/* Permit description link */
.permit-desc-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    color: #0051ba;
}

.permit-desc-link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/*Prevent layout shift from long text */
#lot-search,
#lot-search-sidebar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* CRITICAL FIX: allow flex items to shrink properly */
.control-group {
    min-width: 0;
}

/* Prevent input from forcing container growth */
.lot-search-row {
    min-width: 0;
}

/*Ensure inputs don't overflow flex containers */
.lot-search-row input,
#lot-search,
#lot-search-sidebar {
    min-width: 0;
}



/* Basketball Toggle Container */
.basketball-toggle-card {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f3f3;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Toggle Switch Container */
.basketball-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

/* Checkbox lives at top of .mobile-top-chrome; desktop uses label[for] only */
.basketball-switch input {
    display: none;
}

/* Toggle Background (Track) */
.basketball-switch .slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 20px;
    transition: 0.10s;
}

/* Toggle Knob (Circle) */
.basketball-switch .slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* ON State (Checked) — .filter-card__fields may sit inside .mobile-fixed-controls */
#basketball-toggle:checked ~ .mobile-fixed-controls .filter-card__fields .basketball-switch .slider {
    background: #5ec2a8;
}

#basketball-toggle:checked ~ .mobile-fixed-controls .filter-card__fields .basketball-switch .slider::before {
    transform: translateX(20px);
}

/* Label Text */
#basketball-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.basketball-active {
    color: #5ec2a8;
    font-weight: 600;

}

/* Single checkbox for mobile + desktop basketball UI */
.basketball-toggle-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Desktop: show switch row; mobile uses floating pill */
.basketball-toggle-card--desktop {
    display: flex;
}

@media (max-width: 1023px) {
    .basketball-toggle-card--desktop {
        display: none !important;
    }
}

/* Mobile row 1 — Google Maps–style slim top strip */
.mobile-floating-topbar {
    display: none;
}

@media (max-width: 1023px) {
    /* Row 1: document-flow KU blue; safe-area pads first row (replaces removed ::before strip) */
    .mobile-floating-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        align-self: stretch;
        position: relative;
        width: 100%;
        max-width: 100%;
        left: auto;
        transform: none;
        margin: 0;
        box-sizing: border-box;
        padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
        padding-bottom: 0.32rem;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        background: #0051ba;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
        border-radius: 0;
        pointer-events: auto;
    }

    .mobile-floating-brand {
        display: inline-block;
        font-size: 1.1rem;
        font-weight: 600;
        color: #fff;
        letter-spacing: -0.02em;
        background: none;
        padding: 0;
        box-shadow: none;
    }

    .basketball-pill-mobile {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.3rem 0.7rem 0.3rem 0.8rem;
        background: rgba(255, 255, 255, 0.18);
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        font-size: 0.82rem;
        font-weight: 600;
        color: #fff;
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .basketball-pill-mobile__text {
        color: #fff;
    }

    .basketball-pill-mobile__track {
        position: relative;
        width: 36px;
        height: 20px;
        background: rgba(255, 255, 255, 0.35);
        border-radius: 20px;
        transition: background 0.15s ease;
    }

    .basketball-pill-mobile__knob {
        position: absolute;
        width: 16px;
        height: 16px;
        left: 2px;
        top: 2px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s ease;
    }

    #basketball-toggle:checked ~ .mobile-floating-topbar .basketball-pill-mobile__track {
        background: rgba(255, 255, 255, 0.55);
    }

    #basketball-toggle:checked ~ .mobile-floating-topbar .basketball-pill-mobile__knob {
        transform: translateX(16px);
    }

    /* Row 2: slightly shorter pill + hamburger; sits below margin gap under row 1 */
    .lot-search-floating {
        padding: 0.1rem 0.42rem 0.1rem 0.28rem;
        box-shadow: 0 1px 3px rgba(60, 64, 67, 0.28);
    }

    .lot-search-menu-btn.hamburger-inline {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .lot-search-floating input[type="search"] {
        padding: 0.34rem 0.3rem;
        font-size: 0.94rem;
    }
}

@media (min-width: 1024px) {
    .mobile-floating-topbar {
        display: none !important;
    }
}

/* Search bar: menu + input (mobile layout) */
.lot-search-floating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(60, 64, 67, 0.32);
    padding: 0.2rem 0.5rem 0.2rem 0.35rem;
}

.lot-search-menu-btn.hamburger-inline {
    margin-left: 0;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.lot-search-menu-btn.hamburger-inline span {
    width: 20px;
    height: 2.5px;
    background-color: #202124;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Search active: Google-style back arrow (replaces ☰) */
.lot-search-menu-btn.lot-search-nav--back span {
    display: none !important;
}

.lot-search-menu-btn.lot-search-nav--back::after {
    content: '\2190';
    font-size: 1.45rem;
    line-height: 1;
    color: #202124;
    font-weight: 500;
    display: block;
    margin-top: -2px;
}

.lot-search-floating input[type="search"] {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0.55rem 0.35rem;
    font-size: 1rem;
}

.lot-search-floating input[type="search"]:focus {
    outline: none;
    box-shadow: none;
}

.lot-search-row .lot-search-floating input[type="search"] {
    width: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* TOC drawer (mobile) */
.toc-drawer-backdrop {
    display: none;
}

@media (max-width: 1023px) {
    .toc-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(0, 0, 0, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .toc-drawer-backdrop.toc-drawer-backdrop--visible {
        opacity: 1;
        pointer-events: auto;
    }

    .toc-menu.toc-menu--mobile-drawer {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(300px, 88vw);
        z-index: 1205;
        margin: 0;
        padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0 1rem;
        border-radius: 0;
        border: none;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
        transform: translateX(-105%);
        transition: transform 0.22s cubic-bezier(0.2, 0, 0.2, 1);
        transform-origin: center left;
        opacity: 1;
        pointer-events: auto;
        right: auto;
    }

    .toc-menu.toc-menu--mobile-drawer.toc-menu--drawer-open {
        transform: translateX(0);
    }

    .toc-menu.toc-menu--mobile-drawer a {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}



/* Inline hamburger */
.hamburger-inline {
    position: relative;
    margin-left: auto;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.hamburger-inline span {
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    display: block;
    transition:
        transform 180ms cubic-bezier(0.2, 0, 0.2, 1),
        opacity 120ms ease;
    transform-origin: center;

}


/* Open (X) state */
.hamburger-inline.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    }

.hamburger-inline.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-inline.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* Collapsible TOC */
.toc-menu {
    position: fixed;
    top: 96px;
    right: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 900;
    min-width: 180px;
    z-index: 1400;

    /* animation states */
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: top right;
    transition: 
        opacity 160ms ease,
        transform 160ms cubic-bezier(0.2,0,0.2,1);
}

.toc-menu.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(-6px) scale(.96);
    pointer-events: none;
    visibility: hidden;
}

/* Desktop: only #tocMenu toggles; hide mobile drawer DOM on wide screens */
@media (min-width: 1024px) {
    #tocMenu.toc-menu:not(.hidden) {
        display: block !important;
        visibility: visible;
    }

    #tocMenuMob.toc-menu--mobile-drawer,
    #tocDrawerBackdrop {
        display: none !important;
        pointer-events: none !important;
    }
}

.toc-menu a {
    display: block;
    padding: 8px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #0051ba;
    text-decoration: none;
    font-weight: 600;
}

.toc-menu a:hover {
    background-color: #f5f5f5;
}

/* Mobile: legacy dropdown only for #tocMenu (desktop chrome hidden); #tocMenuMob uses drawer rules above */
@media (max-width: 1023px) {
    #tocMenu.toc-menu {
        left: 12px;
        right: 12px;
        bottom: 70px;
        top: auto;
        width: auto;
    }
}

/* Info button styling */
.info-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    height: 32px;
    width: 32px;
}

.info-button:hover {
    background-color: #f0f0f0;
}

.info-button:active {
    background-color: #e0e0e0;
}

/* Legend container styling */
.legend-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid #333;
}

.legend-text {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .info-button {
        font-size: 1.3rem;
        height: 28px;
        width: 28px;
    }
}
