/**
 * Map Layers - Leaflet.js Specific Styles
 * CSS for the Leaflet map layer in index2.html
 * (General layer styles are inherited from home.css)
 */

/* =============================================
   Layer 3: Leaflet Interactive Map
   ============================================= */

/* Font label icons (width: auto images) */
.font-label-icon {
    background: transparent !important;
    border: none !important;
}

.font-label-icon img {
    display: block;
}

/* Layer 3 background color */
.layer-3 {
    background: #E8F4E8;
    /* Soft green/nature tone to complement the facility map */
}

#leaflet-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #E8F4E8;
    /* Match layer background */
}

/* Map Instruction */
.map-instruction {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px 24px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
    font-family: var(--font-family-base);
    font-size: 14px;
    color: #666666;
    transition: opacity 0.3s ease;
}

.map-instruction svg {
    color: #F9A01B;
}

.map-instruction.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =============================================
   Detail Panel (Layer 3 Slide-out)
   ============================================= */

.map-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px 0 0 20px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.map-detail-panel.open {
    transform: translateX(0);
}

.panel-inner {
    padding: 48px 40px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.panel-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: #F5F7FA;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.panel-close-btn svg {
    width: 20px;
    height: 20px;
    color: #666666;
}

.panel-close-btn:hover {
    background: #E8ECF3;
}

.panel-close-btn:focus {
    background: transparent;
    outline: 2px solid #F9A01B;
    outline-offset: 2px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-top: 24px;
}

.panel-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 160, 27, 0.15);
    border-radius: 50%;
}

.panel-icon svg {
    width: 32px;
    height: 32px;
    color: #F9A01B;
}

.panel-title {
    font-family: 'Onest', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #041A31;
    line-height: 1.2;
    margin: 0;
}

.panel-desc {
    font-family: var(--font-family-base);
    font-size: 15px;
    line-height: 1.8;
    color: #666666;
    margin: 0 0 32px 0;
}

.panel-features {
    background: #F9FAFB;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 32px;
}

.features-heading {
    font-family: 'Onest', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #041A31;
    margin: 0 0 16px 0;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.features-list li {
    font-family: var(--font-family-base);
    font-size: 14px;
    color: #666666;
    padding-left: 24px;
    position: relative;
}

.features-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    background: #F9A01B;
    border-radius: 50%;
}

.panel-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: #F9A01B;
    color: #FFFFFF;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-top: auto;
    align-self: flex-start;
}

.panel-cta-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.panel-cta-btn:hover,
.panel-cta-btn:focus {
    background: #E8890B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 160, 27, 0.3);
}

.panel-cta-btn:hover svg {
    transform: translateX(4px);
}

.panel-cta-btn:focus {
    outline: 2px solid #041A31;
    outline-offset: 2px;
}

/* =============================================
   Custom Leaflet Markers
   ============================================= */

.leaflet-marker-icon.facility-marker-icon {
    background: transparent;
    border: none;
}

.facility-marker-pin {
    width: 56px;
    height: 56px;
    position: relative;
}

.facility-marker-pin .pin-bg {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.facility-marker-pin .pin-icon {
    transform: rotate(45deg);
    color: #F9A01B;
    font-size: 24px;
}

/* TEMPORARILY DISABLED - hover effects
.facility-marker-pin:hover .pin-bg,
.facility-marker-pin.active .pin-bg {
    background: #F9A01B;
    transform: rotate(-45deg) scale(1.1);
}

.facility-marker-pin:hover .pin-icon,
.facility-marker-pin.active .pin-icon {
    color: #FFFFFF;
}
*/

/* Pulse Animation */
.facility-marker-pin::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #F9A01B;
    border-radius: 50%;
    animation: markerPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes markerPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateX(-50%) scale(2);
        opacity: 0;
    }
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background: rgba(40, 56, 146, 0.95);
    color: #FFFFFF;
    border-radius: 20px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px 20px;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 500;
}

.leaflet-popup-tip {
    background: rgba(40, 56, 146, 0.95);
}

.leaflet-popup-close-button {
    color: #FFFFFF !important;
}

/* =============================================
   Layer 3 Scroll Controls Position
   ============================================= */

.layer-3-controls {
    position: fixed;
    right: 80px;
    bottom: 60px;
    z-index: 100;
}

/* =============================================
   Close Button (X) for Layer 2
   ============================================= */

.map-close-btn {
    position: fixed;
    top: 100px;
    right: 40px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
}

.map-close-btn svg {
    width: 24px;
    height: 24px;
    color: #041A31;
    transition: color 0.2s ease;
}

.map-close-btn:hover {
    background: #F9A01B;
}

.map-close-btn:hover svg {
    color: #FFFFFF;
}

.map-close-btn:active {
    transform: scale(0.95);
}

.map-close-btn:focus {
    outline: none;
}

.map-close-btn:focus-visible {
    outline: 2px solid #F9A01B;
    outline-offset: 2px;
}

/* Panel close button */
.panel-close-btn {
    position: absolute;
    top: 8px;
    left: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: none;
}

.panel-close-btn svg {
    width: 20px;
    height: 20px;
    color: #041A31;
    transition: color 0.2s ease;
}

.panel-close-btn:hover svg,
.panel-close-btn:focus svg {
    /* color: #F9A01B; */
}

.panel-close-btn:focus {
    /* outline: 2px solid #F9A01B; */
    /* outline-offset: 2px; */
}

/* Facility Zoom Indicator - show when Layer 2 is active */
.facility-zoom-indicator {
    opacity: 0;
    pointer-events: none;
}

.layer-2.active .facility-zoom-indicator {
    opacity: 1;
    pointer-events: auto;
}

/* Continue Button for Layer 3 */
.continue-btn {
    position: fixed;
    bottom: 120px;
    right: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #F9A01B;
    color: #FFFFFF;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 160, 27, 0.3);
}

.continue-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.continue-btn:hover,
.continue-btn:focus {
    background: #E8890B;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 160, 27, 0.4);
}

.continue-btn:hover svg {
    transform: translateX(4px);
}

.continue-btn:focus {
    outline: 2px solid #041A31;
    outline-offset: 2px;
}

/* =============================================
   Zoom Button Controls
   ============================================= */

.zoom-buttons {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    width: calc(100% - 80px);
    max-width: 400px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.layer-3.active .zoom-buttons,
.zoom-buttons.visible {
    opacity: 1;
}

.zoom-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
}

.zoom-btn svg {
    width: 24px;
    height: 24px;
    color: #041A31;
    transition: color 0.2s ease;
}

.zoom-btn:hover {
    background: #F9A01B;
}

.zoom-btn:hover svg {
    color: #FFFFFF;
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn:focus {
    outline: none;
}

.zoom-btn:focus-visible {
    outline: 2px solid #F9A01B;
    outline-offset: 2px;
}

/* Disabled state when at zoom limits */
.zoom-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.zoom-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.5);
}

.zoom-btn:disabled:hover svg {
    color: #041A31;
}

/* =============================================
   Responsive Styles
   ============================================= */

@media (max-width: 1024px) {
    .map-detail-panel {
        max-width: 400px;
    }

    .panel-inner {
        padding: 40px 32px;
    }

    .panel-title {
        font-size: 24px;
    }

    .layer-3-controls {
        right: 40px;
    }

    .continue-btn {
        right: 40px;
    }

    .map-close-btn {
        top: 80px;
        right: 24px;
        width: 44px;
        height: 44px;
    }

    .map-close-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Layer 2 Hero - Tablet adjustments */
    .layer-2 .hero-overlay .hero-content-wrapper {
        left: 40px;
        width: calc(100% - 80px);
        max-width: 600px;
    }

    .layer-2 .hero-overlay .hero-card {
        padding: 32px;
    }

    .layer2-info-container {
        left: 40px;
        width: calc(100% - 80px);
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .map-instruction {
        bottom: 100px;
        padding: 12px 20px;
        font-size: var(--fluid-small);
    }

    .map-detail-panel {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        height: auto;
        max-height: 85vh;
        top: auto;
        bottom: 0;
        transform: translateY(100%);
    }

    .map-detail-panel.open {
        transform: translateY(0);
    }

    .panel-inner {
        padding: 32px 24px;
    }

    .panel-header {
        padding-top: 16px;
    }

    .panel-icon {
        width: 48px;
        height: 48px;
    }

    .panel-title {
        font-size: 20px;
    }

    .panel-desc {
        font-size: 14px;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    .layer-3-controls {
        right: 16px;
        bottom: 24px;
    }

    .continue-btn {
        right: 16px;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        padding: 12px 20px;
        font-size: var(--fluid-small);
    }

    .zoom-buttons {
        left: 50%;
        bottom: 24px;
        width: auto;
        gap: 0;
        justify-content: center;
    }

    .zoom-btn {
        width: 40px;
        height: 40px;
    }

    .zoom-btn svg {
        width: 20px;
        height: 20px;
    }

    .map-close-btn {
        top: 92px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .map-close-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Layer 2 Hero - Full width, 50% height on mobile (below 80px header) */
    /* Layer 2 Hero - Full height overlay on mobile for centering */
    .layer-2 .hero-overlay {
        top: 0 !important;
        height: 100dvh !important;
        bottom: auto !important;
        padding: 0 !important;
        background: transparent !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Hide dotted pattern on mobile so map is visible below */
    .layer-2 .hero-overlay .dotted-pattern {
        display: none !important;
    }

    .layer-2 .hero-overlay .hero-content-wrapper {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        padding: 12px !important;
        box-sizing: border-box;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .layer-2 .hero-overlay .hero-card {
        width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box;
        text-align: center !important;
    }

    /* Compact hero content for mobile - minimal whitespace */
    .layer-2 .hero-overlay .hero-title {
        font-size: 34px !important;
        /* per typography.md */
        line-height: 1.1 !important;
        margin-bottom: 8px !important;
        margin-top: 24px !important;
    }

    .layer-2 .hero-overlay .hero-description {
        font-size: 16px !important;
        line-height: 1.3 !important;
        margin-bottom: 32px !important;
        text-align: center !important;
    }

    .layer-2 .hero-overlay .logo-grid {
        gap: 6px !important;
        justify-content: center !important;
    }

    .layer-2 .hero-overlay .partner-logo {
        width: 40px !important;
    }

    .layer-2 .hero-overlay .partner-logo img {
        width: 40px !important;
        height: 40px !important;
    }

    /* Scroll controls - fixed at bottom of screen */
    .layer-2 .scroll-controls {
        position: fixed !important;
        bottom: 24px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        z-index: 1600 !important;
    }

    .layer-2 .scroll-label {
        display: none !important;
    }

    /* Scroll Up Indicator - fixed at bottom of screen (index2.html variant) */
    .layer-2 .hero-overlay .scroll-up-indicator {
        position: fixed !important;
        bottom: 24px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        z-index: 1600 !important;
        flex-direction: column-reverse !important;
    }

    .layer-2 .hero-overlay .scroll-up-label {
        font-size: var(--fluid-small) !important;
        color: #666666 !important;
    }

    .layer-2 .hero-overlay .scroll-up-indicator svg {
        width: 36px !important;
        height: 36px !important;
    }
}

@media (max-width: 768px) {
    .layer-2 .hero-overlay {
        height: 100dvh !important;
        top: 0 !important;
        bottom: auto !important;
        padding: 0 !important;
    }

    /* Force wrapper to be full width */
    .layer-2 .hero-overlay .hero-content-wrapper {
        width: 100% !important;
        height: 45vh !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        padding: 0 20px !important;
        /* Add padding for content breathing room */
    }

    /* Force card to be full width */
    .layer-2 .hero-overlay .hero-card {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        border-radius: 20px !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(255, 255, 255, 0.5) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
    }

    /* Disable map blur on mobile */
    .leaflet-map-screen:has(.hero-overlay:not(.hidden)) .leaflet-map-container {
        filter: none !important;
        -webkit-filter: none !important;
    }

    /* =========================================
       WOW FACTOR: Staggered Load Animations
       ========================================= */

    /* Title fade in and slide up */
    .layer-2 .hero-overlay:not(.hidden) .hero-title {
        opacity: 0;
        transform: translateY(30px);
        animation: mobileHeroFadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        animation-delay: 0.1s;
    }

    /* Description fade in and slide up */
    .layer-2 .hero-overlay:not(.hidden) .hero-description {
        opacity: 0;
        transform: translateY(30px);
        animation: mobileHeroFadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        animation-delay: 0.3s;
    }

    /* Logos pop in with stagger */
    .layer-2 .hero-overlay:not(.hidden) .partner-logo {
        opacity: 0;
        transform: scale(0.5);
        animation: mobileHeroPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    .layer-2 .hero-overlay:not(.hidden) .partner-logo:nth-child(1) {
        animation-delay: 0.5s;
    }

    .layer-2 .hero-overlay:not(.hidden) .partner-logo:nth-child(2) {
        animation-delay: 0.6s;
    }

    .layer-2 .hero-overlay:not(.hidden) .partner-logo:nth-child(3) {
        animation-delay: 0.7s;
    }

    .layer-2 .hero-overlay:not(.hidden) .partner-logo:nth-child(4) {
        animation-delay: 0.8s;
    }

    .layer-2 .hero-overlay:not(.hidden) .partner-logo:nth-child(5) {
        animation-delay: 0.9s;
    }

    /* Scroll button pulse animation */
    .layer-2 .hero-overlay:not(.hidden) .scroll-btn {
        opacity: 0;
        animation: mobileHeroPulseIn 0.6s ease forwards;
        animation-delay: 1.1s;
    }

    /* =========================================
       WOW FACTOR: Blur-to-Focus Map Reveal
       ========================================= */

    /* Map starts blurred when hero is visible */
    .leaflet-map-screen:has(.hero-overlay:not(.hidden)) .leaflet-map-container {
        filter: blur(8px) saturate(0.8);
        /* TEMPORARILY DISABLED: scale causes perceived zoom out */
        /* transform: scale(1.05); */
        transition: filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* Map comes into focus AFTER hero dismiss animation completes */
    /* Delay the unblur to create sequential, not simultaneous animation */
    .leaflet-map-screen:has(.hero-overlay.hidden) .leaflet-map-container {
        filter: blur(0) saturate(1);
        /* transform: scale(1); */
        transition-delay: 0.15s;
    }

    /* =========================================
       WOW FACTOR: Dismiss - Smooth Card Slide Up
       ========================================= */

    /* Animate the ENTIRE card sliding up and fading out */
    .layer-2 .hero-overlay.dismissing .hero-card {
        animation: mobileCardSlideUp 0.5s cubic-bezier(0.4, 0, 1, 1) forwards !important;
    }

    .layer-2 .hero-overlay.dismissing .scroll-up-indicator {
        animation: mobileHeroFadeOut 0.3s ease forwards !important;
    }

    .layer-2 .hero-overlay.dismissing~.scroll-controls {
        animation: mobileHeroFadeOut 0.3s ease forwards !important;
    }
}

/* Keyframes for mobile wow factor animations */
@keyframes mobileHeroFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mobileHeroPopIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mobileHeroPulseIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mobileHeroFloatAway {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-40px);
    }
}

@keyframes mobileHeroScaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes mobileHeroFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Card slides up and fades out as a whole unit */
@keyframes mobileCardSlideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px);
    }
}

/* =============================================
   Leaflet Map Screen Container
   ============================================= */

.leaflet-map-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.leaflet-map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #E8F0F8;
    /* Light blue background */
}

/* =============================================
   Layer 2: Leaflet Facility Map with Markers
   ============================================= */

.layer-2 .leaflet-map-container {
    background: #F5F5F5;
    /* Light gray to match facility map edges - adjust color as needed */
}

/* Layer 2 Hero Overlay */
.layer-2 .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    background: transparent;
    pointer-events: none;
    /* Map interaction blocked via :has(.hero-overlay:not(.hidden)) rule */
    transition: opacity 1s ease, transform 1s ease;
}

/* Mobile: Disable transition when dismissing - CSS animations handle the exit */
@media (max-width: 768px) {
    .layer-2 .hero-overlay.dismissing {
        transition: none !important;
    }

    /* When going from dismissing to hidden, make it instant */
    .layer-2 .hero-overlay.dismissing.hidden,
    .layer-2 .hero-overlay.hidden {
        transition: none !important;
    }
}

/* Disable map interaction when hero overlay is visible */
.leaflet-map-screen:has(.hero-overlay:not(.hidden)) .leaflet-map-container {
    pointer-events: none !important;
}

.leaflet-map-screen:has(.hero-overlay:not(.hidden)) .leaflet-map-container .leaflet-interactive {
    pointer-events: none !important;
    cursor: default !important;
}

.layer-2 .hero-overlay .hero-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
}

.layer-2>.scroll-controls {
    position: fixed;
    right: 80px;
    bottom: 60px;
    z-index: 20;
    pointer-events: auto;
}

/* Scroll Up Indicator (index2.html variant) */
.layer-2 .hero-overlay>.scroll-up-indicator {
    position: fixed;
    left: 50%;
    bottom: 60px;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.layer-2 .hero-overlay .scroll-up-indicator svg {
    transform: rotate(180deg);
    animation: bounceUp 2s infinite;
}

.layer-2 .hero-overlay .scroll-up-label {
    font-family: var(--font-family-base);
    font-size: 14px;
    color: #666666;
    white-space: nowrap;
}

@keyframes bounceUp {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: rotate(180deg) translateY(0);
    }

    40% {
        transform: rotate(180deg) translateY(10px);
    }

    60% {
        transform: rotate(180deg) translateY(5px);
    }
}

.layer-2 .hero-overlay.hidden {
    opacity: 0;
    pointer-events: none !important;
}

.layer-2 .hero-overlay.hidden .hero-card,
.layer-2 .hero-overlay.hidden .hero-content-wrapper,
.layer-2 .hero-overlay.hidden>.scroll-controls,
.layer-2 .hero-overlay.hidden>.scroll-up-indicator {
    pointer-events: none !important;
}

.layer-2 .hero-overlay .dotted-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.layer-2 .hero-overlay .hero-content-wrapper {
    position: absolute;
    left: 160px;
    top: 50%;
    transform: translateY(-50%);
    width: 720px;
    z-index: 10;
    border-radius: 20px;
}

/* Layer 2 Info Container */
.layer2-info-container {
    position: absolute;
    top: 104px;
    /* 60px header + 44px padding */
    left: 86px;
    width: 586px;
    min-height: 207px;
    /* Glassmorphism effect - standardized */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    box-sizing: border-box;
    padding: 32px;
    /* JS handles sequencing delay, CSS just does the animation */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.layer2-info-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.layer2-info-container .info-container-title {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #041A31;
    margin: 0 0 12px 0;
}

.layer2-info-container .info-container-text {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #041A31;
    margin: 0 0 16px 0;
}

.layer2-info-container .info-container-cta {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 30px;
    color: #041A31;
    margin: 0;
    text-align: right;
}

/* Layer 2 Info Container - Mobile */
@media (max-width: 768px) {
    .layer2-info-container {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 586px;
        top: 90px;
        padding: 24px;
        text-align: center;
    }

    .layer2-info-container.hidden {
        transform: translateX(-50%) translateY(-20px);
    }

    .layer2-info-container .info-container-title {
        font-size: 16px;
    }

    .layer2-info-container .info-container-text {
        font-size: 16px;
    }

    .layer2-info-container .info-container-cta {
        font-size: 16px;
        text-align: center;
    }
}

/* =========================================
   LAYER 3 INFO CONTAINER
   Same styling as layer2-info-container
   ========================================= */
.layer3-info-container {
    position: absolute;
    top: 104px;
    /* 60px header + 44px padding */
    left: 86px;
    width: 586px;
    min-height: 207px;
    /* Glassmorphism effect - standardized */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    box-sizing: border-box;
    padding: 32px;
    /* JS handles sequencing delay, CSS just does the animation */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.layer3-info-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.layer3-info-container .info-container-title {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #041A31;
    margin: 0 0 12px 0;
}

.layer3-info-container .info-container-text {
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #041A31;
    margin: 0 0 16px 0;
}

.layer3-info-container .info-container-cta {
    font-family: 'Onest', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 30px;
    color: #041A31;
    margin: 0;
    text-align: right;
    cursor: pointer;
}

/* Layer 3 Info Container - Mobile */
@media (max-width: 768px) {
    .layer3-info-container {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 586px;
        top: 90px;
        padding: 24px;
        text-align: center;
    }

    .layer3-info-container.hidden {
        transform: translateX(-50%) translateY(-20px);
    }

    .layer3-info-container .info-container-title {
        font-size: 16px;
    }

    .layer3-info-container .info-container-text {
        font-size: 16px;
    }

    .layer3-info-container .info-container-cta {
        font-size: 18px;
        text-align: center;
    }
}

/* Layer 2 UI elements animation */
/* JS handles sequencing delay, CSS just does the animation */
.layer-2 .map-close-btn,
.layer-2 .facility-zoom-indicator,
.layer-2 .continue-btn {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.layer-2 .map-close-btn.hidden,
.layer-2 .facility-zoom-indicator.hidden,
.layer-2 .continue-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Layer 3 close button hidden state */
.layer-3 .map-close-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Custom Facility Marker */
.leaflet-facility-marker {
    background: none !important;
    border: none !important;
}

.leaflet-facility-marker .facility-marker-pin {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: none;
}

.leaflet-facility-marker .facility-marker-pin svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.2s ease;
}

/* TEMPORARILY DISABLED - hover effects
.leaflet-facility-marker:hover .facility-marker-pin svg,
.leaflet-facility-marker:focus .facility-marker-pin svg {
    fill: #E8890B;
    transform: scale(1.1);
}
*/

/* Facility Tooltip */
.leaflet-facility-tooltip {
    background: rgba(40, 56, 146, 0.95) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 16px !important;
    font-family: var(--font-family-base) !important;
    font-size: var(--fluid-small) !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-facility-tooltip::before {
    border-top-color: rgba(40, 56, 146, 0.95) !important;
}

/* =============================================
   Layer 3: Leaflet Area Map with Animated Bus
   ============================================= */

.layer-3 .leaflet-map-container {
    background: #E8F0F8;
    /* Blue-ish background for area map */
}

/* Custom Bus Marker for Leaflet */
.leaflet-bus-marker {
    background: none !important;
    border: none !important;
    /* Smooth position transitions - duration matches animation speed */
    transition: transform 0.13s linear !important;
}

.leaflet-bus-marker img {
    width: 50px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

/* Font Label Overlays - force dimensions */
.font-label-overlay img {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
}

/* Location Pin Markers (SEQU & LRT) */
.leaflet-location-marker {
    background: none !important;
    border: none !important;
}

.location-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-family-base);
    font-size: var(--fluid-small);
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.location-pin.sequ-pin {
    background: #F9A01B;
    color: #FFFFFF;
}

.location-pin.lrt-pin {
    background: #283892;
    color: #FFFFFF;
}

/* Bus animation trail effect */
.bus-marker-trail {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(249, 160, 27, 0.4);
    border-radius: 50%;
    animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* =============================================
   Layer 3: Facility Map with Animated Bus
   ============================================= */

.layer-3 {
    background: #E8F4E8;
    /* Soft green/nature tone */
}

/* Add margin for header height on desktop */
@media (min-width: 768px) {
    .layer-3 {
        margin-top: 1.5rem;
        /* 24px */
    }
}

.facility-map-content {
    position: relative;
    width: 1920px;
    height: 1080px;
}

/* Facility Info Card */
.facility-info-card {
    position: fixed;
    top: 100px;
    left: 40px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.facility-info-text {
    font-family: var(--font-family-base);
    font-size: 14px;
    line-height: 1.7;
    color: #666666;
    margin: 0;
}

/* Animated Facility Bus */
.animated-facility-bus {
    position: absolute;
    width: 60px;
    height: 39px;
    z-index: 15;
    pointer-events: none;

    /* Follow the facility road path */
    offset-path: path('M 120,580 Q 200,580 280,550 Q 400,500 500,520 Q 650,550 800,530 Q 950,510 1100,540 Q 1250,570 1400,530 Q 1550,490 1700,520');
    offset-rotate: auto;
    offset-anchor: center;

    opacity: 0;
    animation: facilityBusRoute 18s ease-in-out infinite paused;
    transition: opacity 0.5s ease;
}

/* Only animate bus when Layer 3 is active */
.layer-3.active .animated-facility-bus {
    opacity: 1;
    animation-play-state: running;
}

@keyframes facilityBusRoute {
    0% {
        offset-distance: 0%;
    }

    45% {
        offset-distance: 100%;
    }

    50% {
        offset-distance: 100%;
        /* Brief pause at end */
    }

    95% {
        offset-distance: 0%;
    }

    100% {
        offset-distance: 0%;
        /* Brief pause before next trip */
    }
}

/* Facility Zoom Controls Position */
.facility-zoom-controls {
    position: fixed;
    bottom: 120px;
    right: 40px;
    z-index: 100;
}

/* =============================================
   Layer 3 Responsive Styles
   ============================================= */

@media (max-width: 1024px) {
    .facility-info-card {
        top: 80px;
        left: 24px;
        max-width: 280px;
        padding: 20px;
    }

    .facility-info-text {
        font-size: var(--fluid-small);
    }

    .animated-facility-bus {
        width: 50px;
        height: 32px;
    }

    .facility-zoom-controls {
        right: 24px;
        bottom: 100px;
    }
}

@media (max-width: 768px) {
    .facility-info-card {
        top: auto;
        bottom: 140px;
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .animated-facility-bus {
        width: 40px;
        height: 26px;
        /* Adjust path for smaller screens */
        offset-path: path('M 120,580 Q 200,580 280,550 Q 400,500 500,520 Q 650,550 800,530 Q 950,510 1100,540 Q 1250,570 1400,530 Q 1550,490 1700,520');
    }

    .facility-zoom-controls {
        right: 16px;
        bottom: 80px;
    }
}

/* =============================================
   Mobile Draggable Bottom Sheet - Facility Panel
   ============================================= */

/* Drag Handle - Hidden on Desktop */
.panel-drag-handle {
    display: none;
}

@media (max-width: 768px) {

    /* Drag Handle - Visible on Mobile - larger touch target for easier dragging */
    .panel-drag-handle {
        display: flex;
        justify-content: center;
        padding: 24px 0 16px;
        cursor: grab;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
        position: relative;
        z-index: 5;
        flex-shrink: 0;
    }

    .panel-drag-handle:active {
        cursor: grabbing;
    }

    /* Panel gallery upper area is also draggable */
    .panel-gallery {
        cursor: grab;
        touch-action: none;
    }

    .panel-gallery:active,
    .facility-panel.dragging .panel-gallery {
        cursor: grabbing;
    }

    .drag-handle-bar {
        width: 64px;
        height: 6px;
        background: #9CA3AF;
        border-radius: 3px;
        transition: background-color 0.3s ease;
    }

    /* Jiggle animation to hint at drag functionality */
    @keyframes drag-hint-jiggle {

        0%,
        100% {
            transform: translateY(0);
        }

        8% {
            transform: translateY(-12px);
        }

        16% {
            transform: translateY(0);
        }

        24% {
            transform: translateY(-10px);
        }

        32% {
            transform: translateY(0);
        }

        40% {
            transform: translateY(-8px);
        }

        48% {
            transform: translateY(0);
        }

        56% {
            transform: translateY(-6px);
        }

        64% {
            transform: translateY(0);
        }

        72% {
            transform: translateY(-4px);
        }

        80% {
            transform: translateY(0);
        }

        88% {
            transform: translateY(-2px);
        }

        96% {
            transform: translateY(0);
        }
    }

    .panel-drag-handle.hint-jiggle {
        animation: drag-hint-jiggle 1.2s ease-in-out infinite;
    }

    .panel-drag-handle.hint-jiggle .drag-handle-bar {
        background: #F9A01B;
    }

    /* Mobile Panel - Default Collapsed State (50vh - shows gallery only) */
    .facility-panel {
        height: 50vh;
        height: 50dvh;
        max-height: 50vh;
        max-height: 50dvh;
        transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }

    /* When dragging - allow JS to control height, disable transitions and max-height limit */
    .facility-panel.dragging {
        transition: none !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
    }

    /* Mobile Panel - Expanded State (100vh) */
    .facility-panel.expanded {
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
    }

    /* Hide text content when collapsed */
    .facility-panel:not(.expanded) .panel-text {
        display: none !important;
    }

    /* Always show close button - consistent layout in both states */
    .facility-panel .panel-close-btn {
        display: flex !important;
        position: absolute;
        top: 8px;
        left: 16px;
        z-index: 10;
    }

    /* Gallery - fixed padding in both states (no shift on expand) */
    .facility-panel .panel-gallery {
        padding-top: 60px;
        display: flex;
        flex-direction: column;
    }

    /* Fixed gallery main height - same in collapsed and expanded */
    .facility-panel .gallery-main {
        height: calc(50vh - 200px);
        height: calc(50dvh - 200px);
        min-height: 150px;
        flex-shrink: 0;
    }

    .facility-panel .gallery-main-img {
        height: 100%;
        object-fit: cover;
        /* GPU acceleration to prevent flicker during panel expansion */
        will-change: transform;
        transform: translateZ(0);
    }

    /* Collapsed panel gallery height */
    .facility-panel:not(.expanded) .panel-gallery {
        height: calc(50vh - 40px);
        height: calc(50dvh - 40px);
    }

    /* Panel content scroll when expanded */
    .facility-panel.expanded .panel-content {
        overflow-y: auto;
        height: 100%;
    }
}

/* ========================================
   MOBILE BORDER RADIUS OVERRIDE
   All 20px border-radius becomes 10px at 768px and below
   ======================================== */
@media (max-width: 768px) {
    .layer-toggle {
        border-radius: 10px;
    }

    .map-detail-panel {
        border-radius: 10px 10px 0 0;
    }

    .panel-features {
        border-radius: 10px;
    }

    .panel-cta-button {
        border-radius: 10px;
    }

    .leaflet-popup-content-wrapper {
        border-radius: 10px;
    }

    .explore-button {
        border-radius: 10px;
    }

    .layer-2 .hero-overlay .hero-card {
        border-radius: 10px;
    }

    .modal-content {
        border-radius: 10px;
    }

    .modal-image {
        border-radius: 10px;
    }

    .location-pin {
        border-radius: 10px;
    }

    .facility-info-card {
        border-radius: 10px;
    }
}

/* ========================================
   BUILDING LABELS WITH BOUNCING STAR
   ======================================== */

.building-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    white-space: nowrap;
}

.building-label-star {
    width: 24px;
    height: 24px;
    animation: bounce-star 1.5s ease-in-out infinite;
}

/* Star overlay that scales with map zoom */
/* Note: Cannot use transform for animation as it conflicts with Leaflet's transform positioning */
/* Using margin-top animation instead */
.building-star-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show star when layer2-info-container appears - fades in then floats gently */
.building-star-overlay.star-visible {
    will-change: margin-top, opacity;
    animation: star-fade-in 0.8s ease-out forwards, bounce-star-margin 2.5s ease-in-out 0.8s 2;
}

@keyframes star-fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes bounce-star-margin {
    0% { margin-top: 0; }
    4% { margin-top: -0.3px; }
    8% { margin-top: -0.8px; }
    12% { margin-top: -1.4px; }
    16% { margin-top: -2px; }
    20% { margin-top: -2.7px; }
    25% { margin-top: -3.2px; }
    30% { margin-top: -3.6px; }
    35% { margin-top: -3.9px; }
    40% { margin-top: -4px; }
    45% { margin-top: -3.9px; }
    50% { margin-top: -3.6px; }
    55% { margin-top: -3.2px; }
    60% { margin-top: -2.7px; }
    65% { margin-top: -2px; }
    70% { margin-top: -1.4px; }
    75% { margin-top: -0.8px; }
    80% { margin-top: -0.3px; }
    85% { margin-top: 0; }
    100% { margin-top: 0; }
}

.building-label-name {
    display: none;
}

/* Label marker container - hidden */
.building-label-marker {
    display: none;
}

/* Bounce animation for non-Leaflet elements only */
@keyframes bounce-star {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}