/**
 * Find a Location Section Styles
 * Synergy Health Theme
 * Map as full background with overlay panel
 */

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

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

/* Top Fade Overlay - White to Transparent (only affects map) */
.fal-fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Override Leaflet's map panes to ensure popups appear above fade */
.find-location-section .leaflet-map-pane {
    z-index: 1;
}

.find-location-section .leaflet-popup-pane {
    z-index: 700 !important;
}

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

/* Container - 1440px max-width, centered */
.fal-container {
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 700px;
    padding: 0 20px;
}

/* ========================================
   MAP - FULL BACKGROUND (outside container)
   ======================================== */

.fal-map-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    min-height: 700px;
    z-index: 1;
    margin-left: calc(-50vw + 50%);
}

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

/* ========================================
   LEFT PANEL - INSIDE CONTAINER
   ======================================== */

.fal-info-panel {
    position: relative;
    width: 600px;
    max-width: 100%;
    height: 100%;
    min-height: 700px;
    background: var(--teal-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    z-index: 3;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;;
}

.fal-info-content {
    max-width: 100%;
    width: 100%;
}

/* Heading */
.fal-heading {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--white);
    margin: 0 0 25px 0;
}

/* Description */
.fal-description {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.4;
    color: var(--white);
    margin: 0 0 35px 0;
}

.fal-description strong {
    font-weight: 700;
}

/* ========================================
   LOCATION LIST - INTERACTIVE DOTS
   ======================================== */

.fal-location-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
    margin-bottom: 35px;
}

.fal-location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.fal-location-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Location Icon - Pin style (not dots) */
.fal-location-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    filter: brightness(0) invert(1);
}

/* Show the SVG icon */
.fal-location-icon img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Hover/Active State */
.fal-location-item:hover .fal-location-icon,
.fal-location-item.active .fal-location-icon {
    transform: scale(1.2);
}

/* Selected State - Persistent after click */
.fal-location-item.selected .fal-location-icon {
    transform: scale(1.2);
}

.fal-location-item.selected {
    background-color: rgba(255, 255, 255, 0.2);
}

.fal-location-name {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    color: var(--white);
    transition: color 0.3s ease;
}

.fal-location-item.selected .fal-location-name {
    color: var(--white);
    font-weight: 700;
}

/* ========================================
   STATS
   ======================================== */

.fal-stats {
    display: flex;
    gap: 80px;
    margin-bottom: 40px;
    padding: 30px 0;
    position: relative;
}

/* Vertical divider line between stats */
.fal-stats::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.3);
}

.fal-stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fal-stat-number {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 600;
    line-height: 1;
    color: var(--white);
}

.fal-stat-label {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--white);
    opacity: 0.95;
}

/* ========================================
   BUTTONS - ROUNDED/PILL STYLE
   ======================================== */

.fal-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 20px;
}

.fal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 3px solid transparent;
    white-space: nowrap;
}

.fal-btn-primary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

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

.fal-btn-primary:active {
    transform: translateY(0);
}

.fal-btn-primary:focus {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}

.fal-btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

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

.fal-btn-secondary:active {
    transform: translateY(0);
}

.fal-btn-secondary:focus {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}

/* Tagline */
.fal-tagline {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--white);
    margin: 0;
    opacity: 0.95;
}

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

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

.fal-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 - Match WDIH dots */
.fal-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-map-marker 2s ease-out infinite;
    opacity: 0;
    pointer-events: none;
}

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

/* Remove the arrow/pin drop effect */
.fal-marker-pin::after {
    display: none;
}

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

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

/* Pulse Animation for Selected Markers */
@keyframes pulse-marker {
    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);
    }
}

/* Active marker state */
.fal-location-item.active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Leaflet popup customization - Force above fade */
.leaflet-popup-pane {
    z-index: 700 !important;
}

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

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

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

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

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

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

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

.fal-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;
}

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

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

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

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

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

/* Desktop Large (1200px) */
@media (max-width: 1200px) {
    .fal-info-panel {
        width: 480px;
        padding: 50px 40px;
    }
    
    .fal-heading {
        font-size: 32px;
    }
    
    .fal-description {
        font-size: 14px;
    }
    
    .fal-stat-number {
        font-size: 40px;
    }
}

/* Tablet Landscape (1024px) */
@media (max-width: 1024px) {
    .fal-container {
        display: flex;
        flex-direction: column;
        padding: 0;
    }
    
    .fal-map-panel {
        position: static;
        width: 100%;
        min-height: 500px;
        margin-left: 0;
    }
    
    .fal-map {
        min-height: 500px;
    }
    
    .fal-info-panel {
        position: static;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 60px 40px;
    }
    
    .fal-info-content {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .fal-heading {
        font-size: 34px;
    }
    
    .fal-location-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fal-buttons {
        flex-direction: row;
        gap: 15px;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    .find-location-section {
        min-height: auto;
    }
    
    .fal-container {
        min-height: auto;
    }
    
    .fal-info-panel {
        padding: 50px 30px;
    }
    
    .fal-heading {
        font-size: 28px;
        margin-bottom: 18px;
    }
    
    .fal-description {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    .fal-location-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 18px;
        margin-bottom: 30px;
    }
    
    .fal-stats {
        gap: 35px;
        margin-bottom: 30px;
        padding: 20px 0;
    }
    
    .fal-stat-number {
        font-size: 36px;
    }
    
    .fal-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .fal-btn {
        width: 100%;
        text-align: center;
    }
    
    .fal-map-panel {
        min-height: 450px;
    }
    
    .fal-map {
        min-height: 450px;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    .fal-fade-overlay {
        height: 150px;
    }
    
    .fal-info-panel {
        padding: 40px 20px;
    }
    
    .fal-heading {
        font-size: 24px;
    }
    
    .fal-description {
        font-size: 13px;
    }
    
    .fal-location-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .fal-location-name {
        font-size: 14px;
    }
    
    .fal-stats {
        flex-direction: column;
        gap: 20px;
        padding: 18px 0;
    }
    
    .fal-stat-number {
        font-size: 34px;
    }
    
    .fal-stat-label {
        font-size: 11px;
    }
    
    .fal-btn {
        padding: 11px 22px;
        font-size: 14px;
    }
    
    .fal-tagline {
        font-size: 13px;
    }
    
    .fal-map-panel {
        min-height: 400px;
    }
    
    .fal-map {
        min-height: 400px;
    }
}

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

/* Focus States */
.fal-location-item:focus,
.fal-btn:focus {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .fal-location-item,
    .fal-location-icon,
    .fal-btn,
    .fal-marker-pin {
        transition: none;
        animation: none;
    }
    
    .fal-location-item:hover,
    .fal-btn:hover {
        transform: none;
    }
    
    .fal-location-item:hover .fal-location-icon,
    .fal-location-item.active .fal-location-icon,
    .fal-location-item.selected .fal-location-icon {
        transform: none;
        animation: none;
    }
    
    .fal-custom-marker:hover .fal-marker-pin,
    .fal-marker-pin.selected {
        transform: none;
        animation: none;
    }
    
    .fal-marker-pin::before {
        animation: none;
        display: none;
    }
}
