/* ============================================================
   LOCAL MAP UI — YES LET'S GO
   Styles for Google Map, Filter Sidebar & Popups
============================================================ */

/* ------------------------------------------------------------
   MAP CONTAINER
------------------------------------------------------------ */

#local-map {
    width: 100%;
    height: 75vh;
    min-height: 450px;
    overflow: hidden;
    position: relative;
}


/* ------------------------------------------------------------
   FILTER SIDEBAR
------------------------------------------------------------ */

#map-filter-sidebar {
    background: #e8f6ed; /* Removed transparency (was #e8f6ed80) */
    border: 1px solid #e2e2e2;
    padding: 16px;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Desktop: floats left beside map */
    position: absolute;
    top: 0px;
    z-index: 20;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    max-height: calc(75vh);
    overflow-y: auto;
}

#map-filter-toggle {
    display: none; /* Hidden by default on desktop */
}

    /* Scrollbar styling */
    #map-filter-sidebar::-webkit-scrollbar {
        width: 7px;
    }

    #map-filter-sidebar::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 0px;
    }


/* ------------------------------------------------------------
   FILTER BUTTONS
------------------------------------------------------------ */

#category-filters {
    padding: 0px;
}

.filter-btn {
    appearance: none;
    border: none;
    padding: 10px 0px;
    cursor: pointer;
    list-style: none;
    color: #74236C;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-left: 3px solid transparent;
}

    .filter-btn:hover {
        color: #231F20;
        background-color: rgba(116, 35, 108, 0.05);
    }

    .filter-btn.active {
        color: #231F20;
        background-color: rgba(116, 35, 108, 0.1);
        border-left-color: #74236C;
        font-weight: 600;
    }

    /* Add a checkmark icon for selected filters */
    /*.filter-btn.active::after {
        content: "✓";
        position: absolute;
        right: 15px;
        color: #74236C;
        font-weight: bold;
        font-size: 16px;
    }*/

    /* Special styling for "Show All" when active */
    .filter-btn[data-filter="all"].active {
        background-color: rgba(116, 35, 108, 0.15);
        border-left-color: #009792;
    }

    .filter-btn[data-filter="all"].active::after {
        color: #009792;
    }


/* ------------------------------------------------------------
   POPUP (INFO WINDOW)
------------------------------------------------------------ */

.map-popup {
    max-width: 240px;
    font-family: inherit;
}

    .map-popup h3 {
        font-size: 17px;
        margin: 0 0 6px 0;
        color: #222;
    }

    .map-popup p {
        margin: 0 0 12px 0;
        font-size: 14px;
        color: #555;
    }

/* CTA BUTTON */
.map-btn {
    display: inline-block;
    background: #4CAF50;
    color: #fff !important;
    padding: 8px 12px;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

    .map-btn:hover {
        background: #3e8f42;
    }

/* Info Window Styles */
.lmd-info-window {
    max-width: 300px;
}

.lmd-business-image,
.lmd-walk-image,
.lmd-canoe-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}

/* Optional: Different styling for walk/canoe images */
.lmd-walk-image {
    border: 2px solid #eb668b; /* Walk route color border */
}

.lmd-canoe-image {
    border: 2px solid #4CAF50; /* Canoe route color border */
}

.lmd-info-window h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.lmd-excerpt {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.lmd-button-container {
    margin-top: 12px;
}

.lmd-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #009792;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.lmd-btn:hover {
    background-color: #231F20;
    color: white;
}

/* Walk-specific button styling */
.lmd-info-window button.lmd-btn {
    background-color: #eb668b; /* Match walk route color */
}

.lmd-info-window button.lmd-btn:hover {
    background-color: #d14570; /* Darker shade on hover */
}

.lmd-business-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    border-radius: 0px;
    margin-bottom: 10px;
    display: block;
}

.lmd-info-window h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.lmd-info-window p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.lmd-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #009792;
    color: white;
    text-decoration: none;
    border-radius: 0px;
    font-size: 14px;
    transition: background-color 0.3s;
}

    .lmd-btn:hover {
        background-color: #231F20;
        color: white;
    }

.walk_difficulty-easy,
.canoe_difficulty-easy {
    color: #28a745;
}

.walk_difficulty-normal,
.canoe_difficulty-normal {
    color: #ffc107;
}

.walk_difficulty-challenging,
.canoe_difficulty-challenging {
    color: #dc3545;
}

/* ------------------------------------------------------------
   MOBILE SLIDE-OUT SIDEBAR
------------------------------------------------------------ */

@media (max-width: 900px) {

    #map-filter-sidebar {
        width: 90%;
        max-width: 340px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        bottom: 20px;
    }
}

@media (max-width: 650px) {

    #map-filter-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        padding: 20px;
        transform: translateY(calc(100% - 60px)); /* Show only top part by default */
        transition: transform 0.4s ease;
        height: auto;
        max-height: 80vh;
    }

    /* When sidebar is opened - this should work */
    #map-filter-sidebar.open {
        transform: translateY(0%) !important; /* Use !important to ensure it overrides */
    }

    /* Show category filters when sidebar is open */
    #category-filters {
        display: block; /* Always visible when sidebar is open */
    }

    /* Main mobile toggle button (bottom right) */
    #map-filter-toggle {
        display: block !important;
        position: fixed;
        bottom: 15px;
        right: 15px;
        padding: 12px 16px;
        background: #74236C;
        color: white;
        font-size: 24px;
        border: none;
        cursor: pointer;
        z-index: 30;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        border-radius: 0px;
        touch-action: manipulation;
    }

    #map-filter-toggle:active {
        background: #231F20;
    }
}

/* Walk & Canoe Details Panels - Shared Styles */
.walk-details-panel,
.canoe-details-panel {
    position: static; /* Changed from fixed */
    bottom: auto; /* Remove fixed positioning */
    left: auto;
    right: auto;
    background: white;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.15);
    max-height: none; /* Remove height restriction */
    overflow-y: visible; /* Remove scroll */
    transition: opacity 0.3s ease, max-height 0.3s ease; /* Changed transition */
    z-index: auto;
    border-radius: 0px;
    margin-top: 20px; /* Add some spacing from map */
    margin-bottom: 60px; /* Add some spacing from map */
    opacity: 1; /* Default visible */
}

    .walk-details-panel.hidden,
    .canoe-details-panel.hidden {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
        padding: 0;
    }

.close-btn-top {
    display: none;
}

.walk-details-header,
.canoe-details-header {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.walk-featured-image,
.canoe-featured-image {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 0px;
}

.walk-details-title h2,
.canoe-details-title h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.walk-badges,
.canoe-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.difficulty-easy {
    background: #4CAF50;
    color: white;
}

.difficulty-normal {
    background: #FFC107;
    color: #333;
}

.difficulty-challenging {
    background: #F44336;
    color: white;
}

.dog-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 0px;
    font-size: 12px;
    background: #74236C;
    color: #fff;
}

.walk-details-meta,
.canoe-details-meta {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    flex-wrap: wrap;
}

.walk-meta-item,
.canoe-meta-item {
    font-size: 14px;
}

    .walk-meta-item strong,
    .canoe-meta-item strong {
        color: #333;
        margin-right: 5px;
    }

.walk-details-description,
.canoe-details-description {
    padding: 20px;
    line-height: 1.6;
}

.walk-details-actions,
.canoe-details-actions {
    padding: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.walk-pdf-btn,
.walk-gpx-btn,
.walk-close-btn,
.canoe-pdf-btn,
.canoe-gpx-btn,
.canoe-close-btn {
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.2s;
}

.walk-pdf-btn,
.walk-gpx-btn,
.canoe-pdf-btn,
.canoe-gpx-btn {
    background: #74236c;
    color: #fff;
}

    .walk-pdf-btn:hover,
    .walk-gpx-btn:hover,
    .canoe-pdf-btn:hover,
    .canoe-gpx-btn:hover {
        background: #e0e0e0;
        color: #fff;
    }

.walk-close-btn,
.canoe-close-btn {
    background: #e0e0e0;
    color: #333;
    border-radius: 0px;
}

    .walk-close-btn:hover,
    .canoe-close-btn:hover {
        background: #d0d0d0;
    }

/* Mobile responsiveness */
@media (max-width: 768px) {
    .walk-details-header,
    .canoe-details-header {
        flex-direction: column;
    }

    .walk-featured-image,
    .canoe-featured-image {
        width: 100%;
        height: 200px;
    }

    .walk-details-meta,
    .canoe-details-meta {
        flex-direction: column;
        gap: 10px;
    }

    .walk-details-actions,
    .canoe-details-actions {
        flex-direction: column;
    }

    .walk-pdf-btn,
    .walk-gpx-btn,
    .walk-close-btn,
    .canoe-pdf-btn,
    .canoe-gpx-btn,
    .canoe-close-btn {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .walk-close-btn,
    .canoe-close-btn {
        margin-bottom: 0;
    }
}

.walk-active-header,
.canoe-active-header {
    background: linear-gradient(135deg, #eb668b, #d14570);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 10px;
    border-radius: 0px 0px 0 0;
}

/* PDF Embed Styles - Shared for Walk & Canoe */
.walk-pdf-embed,
.canoe-pdf-embed {
    margin-top: 30px;
    border: 1px solid #ddd;
    overflow: hidden;
    background: white;
}

.pdf-embed-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-embed-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.pdf-toggle-btn {
    background: #74236C;
    color: white;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.pdf-toggle-btn:hover {
    background: #231F20;
}

.pdf-embed-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #f5f5f5;
}

.pdf-embed-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Mobile responsiveness for PDF embed */
@media (max-width: 768px) {
    .pdf-embed-header {
        padding: 12px 15px;
    }
    
    .pdf-embed-header h3 {
        font-size: 16px;
    }
    
    .pdf-toggle-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .pdf-embed-container {
        height: 400px;
    }
}

/* Tag styles */
.tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
}

/* Difficulty tags */
.tag-difficulty-easy {
    background-color: #28a745;
}

.tag-difficulty-normal {
    background-color: #ffc107;
}

.tag-difficulty-challenging {
    background-color: #dc3545;
}

/* Dog-friendly tag */
.tag-dog-friendly {
    background-color: #74236C;
}

/* Filter button icons */
.filter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}

.filter-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.filter-icon-img {
    width: 60px; /* 2x the map marker size (36px) */
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.filter-text {
    flex: 1;
}

/* Bike-specific image border */
.lmd-bike-image {
    border: 2px solid #2196F3; /* Bike route color border */
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}

/* Bike difficulty taxonomy colors */
.bike_difficulty-easy {
    color: #28a745;
}

.bike_difficulty-normal {
    color: #ffc107;
}

.bike_difficulty-challenging {
    color: #dc3545;
}

/* Bike Details Panel - Shared Styles with Walk & Canoe */
.bike-details-panel {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    background: white;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.15);
    max-height: none;
    overflow-y: visible;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    z-index: auto;
    border-radius: 0px;
    margin-top: 20px;
    margin-bottom: 60px;
    opacity: 1;
}

.bike-details-panel.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    padding: 0;
}

.bike-details-header {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.bike-featured-image {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 0px;
}

.bike-details-title h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.bike-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bike-details-meta {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    flex-wrap: wrap;
}

.bike-meta-item {
    font-size: 14px;
}

.bike-meta-item strong {
    color: #333;
    margin-right: 5px;
}

.bike-details-description {
    padding: 20px;
    line-height: 1.6;
}

.bike-details-actions {
    padding: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.bike-pdf-btn,
.bike-gpx-btn,
.bike-close-btn {
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.2s;
}

.bike-pdf-btn,
.bike-gpx-btn {
    background: #74236c;
    color: #fff;
}

.bike-pdf-btn:hover,
.bike-gpx-btn:hover {
    background: #e0e0e0;
    color: #fff;
}

.bike-close-btn {
    background: #e0e0e0;
    color: #333;
    border-radius: 0px;
}

.bike-close-btn:hover {
    background: #d0d0d0;
}

/* Bike PDF Embed Styles */
.bike-pdf-embed {
    margin-top: 30px;
    border: 1px solid #ddd;
    overflow: hidden;
    background: white;
}

.bike-active-header {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 10px;
    border-radius: 0px 0px 0 0;
}

/* Mobile responsiveness for bike panels */
@media (max-width: 768px) {
    .bike-details-header {
        flex-direction: column;
    }

    .bike-featured-image {
        width: 100%;
        height: 200px;
    }

    .bike-details-meta {
        flex-direction: column;
        gap: 10px;
    }

    .bike-details-actions {
        flex-direction: column;
    }

    .bike-pdf-btn,
    .bike-gpx-btn,
    .bike-close-btn {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .bike-close-btn {
        margin-bottom: 0;
    }
}
