/**
 * Location Section Styles
 * Synergy Health Theme
 * Full-width map with 300px fade overlay and h2 heading on top
 */

/* ========================================
   SECTION BASE
   ======================================== */

.location-map-section {
    position: relative;
    width: 100%;
    min-height: 700px;
    overflow: hidden;
    background: var(--white);
}

/* ========================================
   MAP CONTAINER - FULL WIDTH
   ======================================== */

.lm-map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 700px;
    z-index: 1;
}

.lm-map {
    width: 100%;
    height: 100%;
    min-height: 700px;
}

/* Hide Leaflet attribution control */
.location-map-section .leaflet-control-attribution {
    display: none !important;
}

/* ========================================
   TOP WHITE SPACE + FADE OVERLAY
   ======================================== */

/* Solid white area at top - 150px */
.location-map-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: var(--white);
    z-index: 2;
    pointer-events: none;
}

/* 300px fade gradient starting after white space */
.location-map-section::before {
    content: '';
    position: absolute;
    top: 150px;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 2;
    pointer-events: none;
}

/* ========================================
   HEADER - POSITIONED ON TOP OF FADE
   ======================================== */

.lm-header-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px 0;
    text-align: center;
    z-index: 3;
}

.lm-heading {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--primary-blue);
    margin: 0;
}

/* ========================================
   MAP MARKERS & POPUPS
   ======================================== */

/* Custom Leaflet marker styles - Match WDIH dots exactly */
.lm-custom-marker {
    background: none;
    border: none;
}

.lm-marker-pin {
    width: 24px;
    height: 24px;
    background-color: var(--red);
    border: 3px solid var(--white);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* Pulse Effect on Map Markers */
.lm-marker-pin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--red);
    transform: translate(-50%, -50%);
    animation: pulse-lm-marker 2s ease-out infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse-lm-marker {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.lm-custom-marker:hover .lm-marker-pin {
    transform: scale(1.3);
    box-shadow: 0 4px 16px rgba(230, 64, 64, 0.4);
}

/* Active/Selected marker state */
.lm-marker-pin.selected {
    transform: scale(1.3);
    box-shadow: 0 4px 16px rgba(230, 64, 64, 0.6);
    animation: pulse-lm-marker-selected 2s ease-in-out infinite;
}

/* Pulse Animation for Selected Markers */
@keyframes pulse-lm-marker-selected {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(230, 64, 64, 0.6);
    }
    50% {
        box-shadow: 0 4px 20px rgba(230, 64, 64, 0.8), 0 0 20px rgba(230, 64, 64, 0.4);
    }
}

/* Leaflet popup customization */
.location-map-section .leaflet-popup-pane {
    z-index: 700 !important;
}

.location-map-section .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.location-map-section .leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lm-popup .leaflet-popup-content-wrapper {
    padding: 0;
}

.lm-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

/* Map info window styles */
.lm-info-window {
    padding: 16px;
    font-family: var(--font-body);
    min-width: 280px;
}

.lm-info-window h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0 0 12px 0;
}

.lm-info-window p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--black);
    margin: 0 0 8px 0;
}

.lm-info-window a {
    display: inline-block;
    margin-top: 10px;
    margin-right: 10px;
    padding: 8px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    background-color: var(--teal-primary);
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}

.lm-info-window a:hover {
    background-color: var(--secondary-green);
}

.lm-info-window a:last-child {
    margin-right: 0;
}

.lm-info-window a[target="_blank"] {
    background-color: var(--primary-blue);
}

.lm-info-window a[target="_blank"]:hover {
    background-color: var(--secondary-blue);
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Tablet Landscape (1024px) */
@media (max-width: 1024px) {
    .location-map-section {
        min-height: 650px;
    }
    
    .lm-map-container,
    .lm-map {
        min-height: 650px;
    }
    
    .lm-heading {
        font-size: 48px;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    .location-map-section {
        min-height: 600px;
    }
    
    .lm-map-container,
    .lm-map {
        min-height: 600px;
    }
    
    .lm-header-container {
        padding: 60px 20px 0;
    }
    
    .lm-heading {
        font-size: 40px;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    .location-map-section {
        min-height: 550px;
    }
    
    .lm-map-container,
    .lm-map {
        min-height: 550px;
    }
    
    .lm-header-container {
        padding: 50px 20px 0;
    }
    
    .lm-heading {
        font-size: 32px;
    }
}

/* ========================================
   LOCATION TYPE FILTERS
   ======================================== */

.location-filters-section {
    width: 100%;
    background: var(--off-white);
    padding: 40px 0 40px;
}

.lm-filters-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Mobile Toggle Button - Hidden on Desktop */
.lm-filter-mobile-toggle {
    display: none;
}

/* Filter Pills Wrapper */
.lm-filter-pills-wrapper {
    width: 100%;
}

/* Filter Pills */
.lm-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.lm-filter-pill {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--red);
    background: transparent;
    border: 3px solid var(--red);
    border-radius: var(--radius-pill);
    padding: 8px 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.lm-filter-pill:hover,
.lm-filter-pill.active {
    background: var(--red);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}

.lm-filter-pill:active {
    transform: translateY(0);
}

.lm-filter-pill:focus {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

/* Hide cards that don't match filter */
.lm-location-card.hidden {
    display: none;
}

/* ========================================
   LOCATION CARDS SECTION
   ======================================== */

.location-cards-section {
    width: 100%;
    background: var(--white);
    padding: 30px 0 60px;
}

.lm-cards-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.lm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.lm-location-card {
    background: var(--teal-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.lm-location-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.lm-card-image-link {
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--white);
}

.lm-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lm-location-card:hover .lm-card-image {
    transform: scale(1.05);
}

.lm-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.lm-card-types {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--white);
    opacity: 0.9;
}

.lm-card-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.lm-card-title a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.lm-card-title a:hover {
    opacity: 0.8;
}

.lm-card-title-text {
    flex: 1;
}

.lm-card-title-chevron {
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.lm-card-title a:hover .lm-card-title-chevron {
    transform: translateX(var(--spacing-xs));
}

.lm-card-address,
.lm-card-phone {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--white);
    margin-top: 8px;
}

.lm-card-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--white);
}

.lm-card-phone a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.lm-card-phone a:hover {
    opacity: 0.8;
}

.lm-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    margin-top: 16px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background: transparent;
    border: 3px solid var(--white);
    border-radius: var(--radius-pill);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.lm-card-button:hover {
    background: var(--white);
    color: var(--teal-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.lm-card-button:active {
    transform: translateY(0);
}

.lm-card-button:focus {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}

/* ========================================
   RESPONSIVE - LOCATION CARDS
   ======================================== */

@media (max-width: 768px) {
    .location-filters-section {
        padding: 0;
        background: var(--white);
    }
    
    /* Show mobile toggle button */
    .lm-filter-mobile-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        font-family: var(--font-body);
        font-size: 20px;
        font-weight: 600;
        color: var(--white);
        background: var(--teal-primary);
        border: none;
        border-radius: 8px;
        padding: 20px 24px;
        margin-top: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    /* Remove bottom border radius when open */
    .lm-filters-container.open .lm-filter-mobile-toggle {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    .mobile-toggle-icon {
        flex-shrink: 0;
        transition: transform 0.3s ease;
    }
    
    .lm-filters-container.open .mobile-toggle-icon {
        transform: rotate(180deg);
    }
    
    /* Pills wrapper - collapsible on mobile */
    .lm-filter-pills-wrapper {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        background: var(--off-white);
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    
    .lm-filters-container.open .lm-filter-pills-wrapper {
        max-height: 1000px;
    }
    
    /* Pills in 2-column grid on mobile */
    .lm-filter-pills {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 30px 35px;
        justify-content: stretch;
    }
    
    .lm-filter-pill {
        font-size: 18px;
        padding: 8px 24px;
        white-space: normal;
        text-align: center;
        width: 100%;
    }
    
    .location-cards-section {
        padding: 20px 0 50px;
    }
    
    .lm-cards-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .lm-card-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .lm-filter-mobile-toggle {
        font-size: 18px;
        padding: 18px 20px;
    }
    
    .lm-filter-pills {
        gap: 12px;
        padding: 20px;
    }
    
    .lm-filter-pill {
        font-size: 16px;
        padding: 8px 16px;
    }
    
    .location-cards-section {
        padding: 20px 0 40px;
    }
    
    .lm-cards-container {
        padding: 0 15px;
    }
    
    .lm-card-content {
        padding: 20px;
        gap: 14px;
    }
    
    .lm-card-title {
        font-size: 20px;
    }
    
    .lm-card-address,
    .lm-card-phone {
        font-size: 14px;
    }
    
    .lm-card-button {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lm-marker-pin {
        transition: none;
        animation: none;
    }
    
    .lm-custom-marker:hover .lm-marker-pin,
    .lm-marker-pin.selected {
        transform: none;
        animation: none;
    }
    
    .lm-marker-pin::before {
        animation: none;
        display: none;
    }
    
    .lm-location-card,
    .lm-card-image,
    .lm-card-button {
        transition: none;
    }
    
    .lm-location-card:hover,
    .lm-card-button:hover {
        transform: none;
    }
}
