/******************************************************************************
 * Virginia Golf Explorer
 * style.css
 ******************************************************************************/

/******************************************************************************
 * Reset
 ******************************************************************************/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

/******************************************************************************
 * Application Layout
 ******************************************************************************/

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app {
    flex: 1;
    display: flex;
    min-height: 0;
}

/******************************************************************************
 * Header
 ******************************************************************************/

#header {

    height: 72px;

    flex-shrink: 0;

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 0 28px;

    background: white;

    border-bottom: 1px solid #d8d8d8;

    box-shadow: 0 2px 8px rgba(0,0,0,.08);

    z-index: 1000;

}

.title-section h1 {

    color: #0b5e2b;

    font-size: 1.9rem;

    margin-bottom: 4px;

}

.title-section p {

    color: #666;

    font-size: .95rem;

}

.course-counter {

    text-align: right;

}

.course-counter span:first-child {

    display: block;

    color: #777;

    font-size: .9rem;

}

#course-count {

    display: block;

    font-size: 2rem;

    font-weight: bold;

    color: #0b5e2b;

}

/******************************************************************************
 * Sidebar
 ******************************************************************************/

#sidebar {

    width: 270px;

    background: white;

    border-right: 1px solid #dcdcdc;

    overflow-y: auto;

    padding: 20px;

    flex-shrink: 0;

}

#legend h3 {

    color: #0b5e2b;

    margin-bottom: 16px;

}

#legend h4 {

    margin-top: 18px;

    margin-bottom: 10px;

    color: #555;

}

.legend-item {

    display: flex;

    align-items: center;

    gap: 12px;

    margin: 10px 0;

}

.legend-item svg {

    width: 32px;

    height: 40px;

    flex-shrink: 0;

}

.legend-color {

    width: 18px;

    height: 18px;

    border-radius: 50%;

    border: 2px solid #333;

    flex-shrink: 0;

}

#legend hr {

    margin: 20px 0;

    border: none;

    border-top: 1px solid #e0e0e0;

}

/******************************************************************************
 * Map
 ******************************************************************************/

#map-container {

    flex: 1;

    position: relative;

    min-width: 0;

    min-height: 0;

}

#map {

    width: 100%;

    height: 100%;

}

/******************************************************************************
 * Popups
 ******************************************************************************/

.popup h3 {

    color: #0b5e2b;

    margin-bottom: 10px;

}

.popup-row {

    margin-bottom: 8px;

}

.popup-address {

    margin: 12px 0;

    line-height: 1.5;

}

.popup a {

    color: #0066cc;

    text-decoration: none;

}

.popup a:hover {

    text-decoration: underline;

}

/******************************************************************************
 * Leaflet
 ******************************************************************************/

.leaflet-container {

    background: #d8eaf6;

}

.leaflet-popup-content {

    min-width: 220px;

    font-size: .95rem;

    line-height: 1.45;

}

.leaflet-control-zoom {

    box-shadow: 0 2px 8px rgba(0,0,0,.20);

}

/******************************************************************************
 * Responsive
 ******************************************************************************/

@media (max-width:900px) {

    #app {

        flex-direction: column;

    }

    #sidebar {

        width: 100%;

        height: 220px;

        border-right: none;

        border-bottom: 1px solid #ddd;

    }

    #header {

        height: auto;

        padding: 16px;

        flex-direction: column;

        align-items: flex-start;

        gap: 12px;

    }

}
/* ==========================================================
   Filters
   ========================================================== */

#filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#filters h2 {
    margin: 0 0 8px;
    color: #0b5e2b;
    font-size: 1.4rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group h3 {
    margin: 0;
    color: #444;
    font-size: 1rem;
}

.filter-group label:first-child {
    font-weight: 600;
    color: #444;
}

#search-box {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    font-size: .95rem;
}

#search-box:focus {
    outline: none;
    border-color: #0b5e2b;
    box-shadow: 0 0 0 3px rgba(11,94,43,.15);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: .95rem;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#reset-filters {
    margin-top: 6px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #0b5e2b;
    color: white;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

#reset-filters:hover {
    background: #087124;
}

#filter-results {
    margin-top: 8px;
    text-align: center;
}

.results-label {
    color: #666;
    font-size: .9rem;
}

.results-count {
    margin: 2px 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: #0b5e2b;
}

#filters hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #e3e3e3;
}
/* ==========================================================
   Collapsible Sidebar
   ========================================================== */

#sidebar {

    position: relative;

    width: 280px;

    transition: width 0.25s ease;

}

#sidebar.collapsed {

    width: 52px;

}

#sidebar-toggle {

    position: absolute;

    top: 14px;

    right: 12px;

    width: 30px;

    height: 30px;

    border: 1px solid #d9d9d9;

    border-radius: 6px;

    background: white;

    color: #0b5e2b;

    font-size: 1rem;

    font-weight: bold;

    cursor: pointer;

    transition:
        background .2s,
        transform .25s;

    z-index: 1000;

}

#sidebar-toggle:hover {

    background: #f2f2f2;

}

#sidebar.collapsed #sidebar-toggle {

    transform: rotate(180deg);

}

#sidebar-content {

    transition:
        opacity .2s ease,
        visibility .2s ease;

}

#sidebar.collapsed #sidebar-content {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

}

#sidebar.collapsed {

    overflow: hidden;

}