/**
 * Homepage Styles
 * Multi-Layer Wheel-Based System with Dotted Pattern Background
 */

/* Prevent body scroll on homepage */
body:has(.layer-container) {
    overflow: hidden;
    height: 100vh;
}

/* Fallback for browsers without :has() support */
html.no-scroll,
body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* Fixed viewport container */
.layer-viewport {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* Layer container - no scroll, wheel-based transitions */
.layer-container {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Base layer styling */
.layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

/* Dotted Pattern Background */
.dotted-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(40, 56, 146, 0.15) 2px, transparent 2px);
    background-size: 58px 58px;
    background-position: 29px 29px;
    pointer-events: none;
    z-index: 1;
}

/* Layer 1: Hero with dotted pattern overlay */
.layer-1 {
    z-index: 30;
    background: #F5F7FA;
}

.layer-1.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Layer 1 background - centered with 12.5% margin on each side (240px at 1920px) */
.layer-1 .map-background {
    left: 12.5%;
    right: 12.5%;
    width: 75%;
}

/* Layer 2: Interactive map */
.layer-2 {
    z-index: 20;
    background: #FFFFFF;
}

.layer-2.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Hide fixed elements when Layer 2 is hidden */
.layer-2.hidden .map-info-card,
.layer-2.hidden .map-travel-badge,
.layer-2.hidden .map-zoom-controls,
.layer-2.hidden .map-scale-indicator {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

/* Layer 3: Background/Base layer */
.layer-3 {
    z-index: 10;
    background: linear-gradient(135deg, #F5F7FA 0%, #E8ECF3 100%);
}

/* Header Styles */
.home-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 60px;
    background: transparent;
}

.home-header .header-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-header .logo {
    display: flex;
    align-items: center;
}

.home-header .logo img {
    height: 48px;
}

.home-header .logo-text {
    font-family: 'Onest', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #F9A01B;
}

.home-header .logo-subtext {
    font-size: 10px;
    color: #283892;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.home-header .main-nav {
    display: flex;
    gap: 48px;
}

.home-header .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #041A31;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.home-header .nav-link.active {
    color: #F9A01B;
}

.home-header .nav-link:hover {
    color: #F9A01B;
}

.home-header .btn-contact {
    padding: 12px 24px;
    border: 1.5px solid #041A31;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #041A31;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-header .btn-contact:hover {
    background: #041A31;
    color: white;
}

/* Layer 1 Content: Hero with glassmorphic card */
.hero-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 80px 0 0;
    position: relative;
}

.hero-content-wrapper {
    display: flex;
    align-items: center;
    position: absolute;
    left: 160px;
    top: 50%;
    transform: translateY(-50%);
    width: 720px;
    height: 810px;
    z-index: 10;
}

/* Glassmorphic Hero Card */
.hero-card {
    position: relative;
    z-index: 10;
    width: 720px;
    height: 810px;
    max-width: 100%;
    padding: 64px 56px;
    background: rgba(255, 255, 255, 0.00);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Transition for shrink animation */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s ease;
    transform-origin: left center;
}

/* Hero card shrinks and fades when Layer 1 is hidden */
.layer-1.hidden .hero-card {
    transform: scale(0.7);
    opacity: 0;
}

/* Ensure hero card is visible when Layer 1 is active */
.layer-1.active .hero-card {
    transform: scale(1);
    opacity: 1;
}

/* Map Illustration Container */
.hero-map-container {
    position: absolute;
    top: 50%;
    right: -60px;
    transform: translateY(-50%);
    width: 58%;
    max-width: 850px;
    height: auto;
    z-index: 5;
}

.map-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-title {
    font-family: 'Onest', sans-serif;
    font-size: 64px;
    font-weight: 400;
    line-height: 1.1;
    color: #041A31;
    margin-bottom: 24px;
}

.hero-description {
    font-family: 'Onest', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 30px;
    color: #041A31;
    width: 531px;
    max-width: 100%;
    margin-bottom: 40px;
}

.hero-instruction {
    font-size: 14px;
    color: #888;
    margin-bottom: 80px;
    display: none; /* Hidden in this layer */
}

/* Logo Grid - Partner/Accreditation Logos */
.logo-grid {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.partner-logo {
    width: 84px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.partner-logo-text {
    font-weight: bold;
    font-size: 10px;
}

.partner-logo-text.primary {
    color: #F9A01B;
    font-size: 14px;
}

.partner-logo-text.secondary {
    color: #283892;
}

/* Scroll Controls */
.scroll-controls {
    position: absolute;
    right: 80px;
    bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 20;
}

.scroll-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #666;
    letter-spacing: 0.05em;
}

.scroll-buttons {
    display: flex;
    gap: 0;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1.5px solid #F9A01B;
    color: #F9A01B;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.scroll-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.scroll-btn:hover,
.scroll-btn:focus {
    background: #F9A01B;
    color: white;
    outline: none;
}

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

/* Layer 2: Full Screen Interactive Map */
.map-full-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Draggable Map Content - maintains 1920px width on smaller screens */
.map-draggable-content {
    position: relative;
    width: 100%;
    height: 100%;
    will-change: transform;
}

/* Enable dragging on screens smaller than 1920px or 1080px height */
@media (max-width: 1919px) {
    .map-draggable-content {
        width: 1920px;
        height: 1080px;
        cursor: grab;
        touch-action: none;
        user-select: none;
    }
}

/* Zoom out on mobile for better overview - 65% scale */
@media (max-width: 768px) {
    .map-draggable-content {
        width: 1248px;  /* 1920 * 0.65 */
        height: 702px;  /* 1080 * 0.65 */
    }

    .map-background img {
        width: 1248px;
        height: 702px;
    }

    /* Scale bus size for zoomed out view */
    .animated-bus {
        width: 33px;  /* 50 * 0.65 */
        height: 21px; /* 32 * 0.65 */
        /* Adjust path coordinates for 65% scale */
        offset-path: path('M 650,390 Q 605,410 618,475 Q 637,514 657,553');
    }

    .map-draggable-content:active,
    .map-draggable-content.dragging {
        cursor: grabbing;
    }

    /* Drag hint indicator */
    .map-full-screen::after {
        content: 'Drag to explore';
        position: absolute;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-family: var(--font-primary);
        z-index: 100;
        pointer-events: none;
        opacity: 1;
        transition: opacity 0.5s ease;
    }

    .map-full-screen.dragged::after {
        opacity: 0;
    }

}

/* Map Background */
.map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-background img {
    width: 100%;
    height: 100%;
    /*object-fit: cover;*/
    object-position: center;
}

/* On smaller screens, maintain 1920x1080 dimensions for the map image */
@media (max-width: 1919px) {
    .map-background img {
        width: 1920px;
        height: 1080px;
        object-fit: cover;
    }
}

/* Information Card - Fixed Position */
.map-info-card {
    position: fixed;
    top: 100px;
    left: 49px;
    width: 586px;
    max-width: calc(100% - 98px);
    height: auto;
    padding: 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    z-index: 50;
    display: flex;
    align-items: center;
    /* Animation - fade and slide in */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
    pointer-events: none;
}

/* Animate in when Layer 2 is active */
.layer-2.active .map-info-card {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.map-info-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
    color: #666666;
    margin: 0;
}

/* Interactive Map Markers */
.map-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Individual Marker */
.map-marker {
    position: absolute;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -100%);
    transition: transform 0.2s ease;
    z-index: 10;
}

.map-marker:hover,
.map-marker:focus {
    transform: translate(-50%, -100%) scale(1.15);
    z-index: 20;
}

.map-marker:focus {
    outline: none;
}

.map-marker:focus-visible {
    outline: 2px solid #041A31;
    outline-offset: 4px;
    border-radius: 50%;
}

/* Marker Icon */
.marker-icon {
    width: 100%;
    height: 100%;
    color: #F9A01B;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: color 0.2s ease;
}

.map-marker:hover .marker-icon,
.map-marker:focus .marker-icon,
.map-marker.active .marker-icon {
    color: #283892;
}

/* Legacy Landmark Labels (keeping for backwards compatibility) */
.map-landmarks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.landmark {
    position: absolute;
    font-family: 'Onest', sans-serif;
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: #1E3A5F;
    white-space: nowrap;
    transform: translateX(-50%);
}

/* Legacy map styles (keeping for backwards compatibility) */
.map-full {
    width: 100%;
    height: 100%;
    padding: 80px 0 0;
    display: flex;
    flex-direction: column;
}

.map-header {
    padding: 24px 60px;
}

.map-header .map-description {
    max-width: 400px;
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}

.map-header .hero-instruction {
    margin-top: 16px;
}

.map-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px;
}

.map-interactive {
    width: 1440px;
    max-width: 100%;
    height: calc(100vh - 200px);
    max-height: 810px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

.map-interactive img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cookie Banner (for Layer 2) - temporarily hidden */
.cookie-banner {
    display: none; /* TODO: Remove to show cookie banner */
    position: absolute;
    right: 49px;
    bottom: 49px;
    width: 340px;
    background: #F5F7FA;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.cookie-text {
    font-size: 12px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 16px;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.cookie-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-btn.accept {
    background: #283892;
    color: white;
    border: none;
}

.cookie-btn.reject {
    background: transparent;
    border: 1px solid #666;
    color: #666;
}

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

.cookie-manage {
    font-size: 11px;
    color: #666;
    text-align: center;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    padding: 4px;
}

.cookie-manage:hover,
.cookie-manage:focus {
    text-decoration: underline;
    outline: none;
}

/* Layer 3: Interactive Map */
.interactive-map-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.interactive-map-screen .map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.interactive-map-screen .map-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Scroll controls for Layer 3 */
.layer-3-controls {
    position: absolute;
    right: 80px;
    bottom: 60px;
    z-index: 20;
}

/* Legacy Layer 3 styles (keeping for backwards compatibility) */
.layer-3-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
}

.layer-3-message {
    text-align: center;
}

.layer-3-message h2 {
    font-family: 'Onest', sans-serif;
    font-size: 48px;
    color: #041A31;
    margin-bottom: 16px;
}

.layer-3-message p {
    font-size: 16px;
    color: #666;
}

/* Layer Indicator */
.layer-indicator {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.indicator-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(4, 26, 49, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.indicator-btn.active {
    background: #F9A01B;
    transform: scale(1.2);
}

.indicator-btn:hover {
    background: rgba(249, 160, 27, 0.6);
}

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

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #041A31;
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
}

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

/* Tablet and smaller desktop */
@media (max-width: 1280px) {
    .hero-content-wrapper {
        padding: 0 60px;
    }

    .hero-card {
        width: 480px;
        min-width: 350px;
        padding: 40px 48px;
    }

    .hero-title {
        font-size: 52px;
    }

    .hero-map-container {
        width: 55%;
    }

    .scroll-controls {
        right: 40px;
    }

    /* Map info card */
    .map-info-card {
        width: 300px;
        padding: 24px;
        left: 40px;
        top: 100px;
    }

    .map-info-text {
        font-size: 13px;
    }

    .landmark {
        font-size: 11px;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .hero-content-wrapper {
        flex-direction: column;
        justify-content: center;
        padding: 0 40px;
    }

    .hero-card {
        width: 100%;
        max-width: 600px;
        min-width: auto;
        margin-bottom: 40px;
    }

    .hero-title {
        font-size: 48px;
    }

    .hero-map-container {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        max-width: 700px;
    }

    .dotted-pattern {
        background-size: 40px 40px;
        background-position: 20px 20px;
    }

    .scroll-controls {
        right: 24px;
        bottom: 40px;
    }

    .layer-indicator {
        right: 20px;
    }

    /* Map info card tablet */
    .map-info-card {
        width: 280px;
        padding: 20px;
        left: 24px;
    }

    .map-info-text {
        font-size: 12px;
        line-height: 1.7;
    }

    .cookie-banner {
        right: 24px;
        bottom: 24px;
        width: 300px;
        padding: 16px;
    }

    .landmark {
        font-size: 10px;
    }

    /* Travel badge tablet */
    .map-travel-badge {
        left: 24px;
        bottom: 100px;
    }

    /* Zoom controls tablet */
    .map-zoom-controls {
        right: 24px;
        bottom: 100px;
    }

    /* Scale indicator tablet */
    .map-scale-indicator {
        right: 24px;
        bottom: 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero-content-wrapper {
        padding: 0 24px;
    }

    .hero-card {
        padding: 32px 28px;
        border-radius: 20px;
    }

    .hero-title {
        font-size: 36px;
        margin-bottom: 16px;
    }

    .hero-description {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .logo-grid {
        gap: 12px;
    }

    .partner-logo {
        width: 60px;
    }

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

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

    .scroll-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .layer-indicator {
        display: none;
    }

    /* Map info card mobile */
    .map-info-card {
        width: calc(100% - 32px);
        max-width: 350px;
        left: 16px;
        top: 90px;
        padding: 16px;
    }

    .map-info-text {
        font-size: 12px;
    }

    .cookie-banner {
        right: 16px;
        bottom: 16px;
        width: calc(100% - 32px);
        max-width: 300px;
    }

    .map-landmarks {
        display: none;
    }

    /* Mobile markers */
    .map-marker {
        width: 36px;
        height: 36px;
    }

    .tooltip-text {
        font-size: 12px;
        padding: 8px 14px;
    }

    /* Travel badge mobile */
    .map-travel-badge {
        bottom: auto;
        top: 320px;
        left: 16px;
        padding: 12px 16px;
        border-radius: 12px;
    }

    .travel-time {
        font-size: 14px;
    }

    .travel-label {
        font-size: 10px;
    }

    /* Zoom controls mobile */
    .map-zoom-controls {
        bottom: 100px;
        right: 16px;
    }

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

    /* Scale indicator mobile */
    .map-scale-indicator {
        bottom: 24px;
        right: 16px;
    }

    .scale-bar {
        width: 50px;
    }

    .scale-label {
        font-size: 11px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero-content-wrapper {
        padding: 0 16px;
    }

    .hero-card {
        padding: 24px 20px;
    }

    .hero-title {
        font-size: 32px;
    }

    .partner-logo {
        width: 50px;
    }
}

/* =============================================
   Layer 2: Travel Time Badge
   ============================================= */

.map-travel-badge {
    position: fixed;
    bottom: 120px;
    left: 49px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.layer-2.active .map-travel-badge {
    opacity: 1;
    transform: translateY(0);
}

.travel-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.travel-icon {
    width: 28px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.travel-icon.walk-icon {
    width: 20px;
    height: 20px;
    color: #666666;
}

.travel-time {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #041A31;
}

.travel-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* =============================================
   Layer 2: Map Zoom Controls
   ============================================= */

.map-zoom-controls {
    position: fixed;
    bottom: 120px;
    right: 49px;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 50;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
}

.layer-2.active .map-zoom-controls {
    opacity: 1;
    transform: translateX(0);
}

.map-zoom-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #041A31;
}

.map-zoom-btn:first-child {
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.map-zoom-btn:last-child {
    border-radius: 0 0 12px 12px;
}

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

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

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

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

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

/* Zoom level indicator */
.map-zoom-controls::after {
    content: attr(data-zoom);
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.map-zoom-controls.show-level::after {
    opacity: 1;
}

/* =============================================
   Layer 2: Scale Indicator
   ============================================= */

.map-scale-indicator {
    position: fixed;
    bottom: 49px;
    right: 49px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 50;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
}

.layer-2.active .map-scale-indicator {
    opacity: 1;
    transform: translateY(0);
}

.scale-bar {
    width: 60px;
    height: 4px;
    background: #041A31;
    border-radius: 2px;
    position: relative;
}

.scale-bar::before,
.scale-bar::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 10px;
    background: #041A31;
    top: -3px;
}

.scale-bar::before {
    left: 0;
}

.scale-bar::after {
    right: 0;
}

.scale-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #041A31;
}

/* =============================================
   Layer 2: Animated Bus
   ============================================= */

.animated-bus {
    position: absolute;
    width: 77px;
    height: 50px;
    z-index: 15;
    pointer-events: none;
    opacity: 0;

    /* Follow the orange dashed shuttle route: SEQU → Kelana Jaya LRT Station
       Coordinates aligned with the orange dashed line in layer2.svg */
    /* S-curve: top-right (SEQU) → curves left → curves back right (LRT Station) */
    offset-path: path('M 1000,600 Q 930,630 950,730 Q 980,790 1010,850');
    offset-rotate: 0deg;
    offset-anchor: center;
    offset-distance: 0%;
    animation: busShuttleRoute 45s linear infinite paused;
    transition: opacity 0.5s ease;
}

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

.bus-icon {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Bus shuttle route animation: travels to LRT station and back */
@keyframes busShuttleRoute {
    0% {
        offset-distance: 0%;
    }
    5% {
        offset-distance: 0%;
        /* Gentle start pause at SEQU */
    }
    45% {
        offset-distance: 100%;
    }
    55% {
        offset-distance: 100%;
        /* Pause at LRT station */
    }
    95% {
        offset-distance: 0%;
    }
    100% {
        offset-distance: 0%;
        /* Pause at SEQU before next trip */
    }
}

/* =============================================
   Layer 3: Facility Markers
   ============================================= */

.facility-map {
    /* Use the isometric facility view */
}

.facility-map img {
    object-fit: contain;
    object-position: center;
    background: linear-gradient(135deg, #F5F7FA 0%, #E8ECF3 100%);
}

.facility-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
}

/* Facility Marker Button */
.facility-marker {
    position: absolute;
    width: 56px;
    height: 56px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -85%);
    transition: transform 0.2s ease;
    z-index: 20;
}

.facility-marker:hover,
.facility-marker:focus {
    transform: translate(-50%, -85%) scale(1.05);
    z-index: 30;
}

.facility-marker:focus {
    outline: none;
}

.facility-marker:focus-visible .facility-pin {
    outline: 3px solid #041A31;
    outline-offset: 4px;
}

.facility-marker.active {
    z-index: 35;
}

/* Facility Pin */
.facility-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    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);
    transition: all 0.2s ease;
    pointer-events: none;
}

.facility-pin svg {
    width: 28px;
    height: 28px;
    transform: rotate(45deg);
    color: #F9A01B;
    pointer-events: none;
}

.facility-marker:hover .facility-pin,
.facility-marker:focus .facility-pin,
.facility-marker.active .facility-pin {
    background: #F9A01B;
    transform: rotate(-45deg) scale(1.1);
}

.facility-marker:hover .facility-pin svg,
.facility-marker:focus .facility-pin svg,
.facility-marker.active .facility-pin svg {
    color: #FFFFFF;
}

/* Pulse animation for markers */
@keyframes markerPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-50%) scale(2);
        opacity: 0;
    }
}

.facility-marker::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;
    pointer-events: none;
}

/* =============================================
   Facility Detail Panel
   ============================================= */

.facility-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    height: 1050px;
    max-height: 100vh;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.25);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

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

.facility-panel[aria-hidden="false"] {
    transform: translateX(0);
}

.panel-content {
    padding: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Panel Back Button */
.panel-back {
    position: absolute;
    top: 65px;
    left: 27px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.panel-back svg {
    width: 15px;
    height: 27px;
}

.panel-back:hover svg path,
.panel-back:focus svg path {
    fill: #F5953A;
}

.panel-back:focus {
    outline: 2px solid #F9A01B;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Panel Gallery */
.panel-gallery {
    padding: 108px 75px 0 75px;
    margin-bottom: 0;
}

.gallery-main {
    width: 450px;
    height: 337px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    background: #E8E8E8;
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnails {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-nav {
    width: 15px;
    height: 27px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.2s ease;
}

.gallery-nav.gallery-prev {
    order: -1;
    margin-right: 20px;
    margin-left: -35px;
}

.gallery-nav.gallery-next {
    order: 1;
    margin-left: 10px;
}

.gallery-nav svg {
    width: 15px;
    height: 27px;
}

.gallery-nav:hover svg path,
.gallery-nav:focus svg path {
    fill: #E8890B;
}

.gallery-nav:focus {
    outline: 2px solid #F9A01B;
    outline-offset: 4px;
    border-radius: 2px;
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-thumbs-container {
    display: flex;
    gap: 5px;
    overflow: hidden;
}

.gallery-thumb {
    width: 139px;
    height: 104px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    padding: 0;
    background: transparent;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb:hover,
.gallery-thumb:focus {
    border-color: #F5953A;
}

.gallery-thumb.active {
    border-color: #F5953A;
}

/* Panel Text Content */
.panel-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px 75px 40px 75px;
}

.panel-title {
    font-family: 'Onest', sans-serif;
    font-size: 32px;
    font-style: normal;
    font-weight: 400;
    line-height: 105%;
    color: #041A31;
    margin: 0 0 20px 0;
}

/* Panel Description */
.panel-description {
    font-family: 'Onest', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    color: #041A31;
    margin: 0;
    padding-top: 16px;
}

/* Panel Link */
.panel-link {
    font-family: 'Onest', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    color: #283892;
    text-decoration: underline;
    text-decoration-style: solid;
    text-underline-offset: auto;
    transition: color 0.2s ease;
    margin-top: 50px;
}

.panel-link:hover,
.panel-link:focus {
    color: #F5953A;
}

.panel-link:focus {
    outline: 2px solid #F9A01B;
    outline-offset: 4px;
    border-radius: 2px;
}

/* Panel Overlay (for closing on outside click) */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* =============================================
   Responsive: Animated Bus & Panel
   ============================================= */

@media (max-width: 1024px) {
    .animated-bus {
        width: 58px;
        height: 38px;
    }

    .facility-panel {
        width: 500px;
        height: auto;
        max-height: 100vh;
    }

    .panel-back {
        top: 20px;
        left: 20px;
    }

    .panel-gallery {
        padding: 80px 50px 0 50px;
    }

    .gallery-main {
        width: 100%;
        height: auto;
        aspect-ratio: 450 / 337;
    }

    .panel-text {
        padding: 25px 50px 30px 50px;
    }

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

    .panel-description {
        font-size: 16px;
    }

    .gallery-thumb {
        width: 100px;
        height: 75px;
    }
}

@media (max-width: 768px) {
    /* Bus remains visible - map maintains 1920px width with drag */
    .animated-bus {
        width: 50px;
        height: 32px;
    }

    .facility-marker {
        width: 40px;
        height: 40px;
    }

    .facility-pin {
        width: 40px;
        height: 40px;
    }

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

    .facility-panel.open,
    .facility-panel[aria-hidden="false"] {
        transform: translateY(0);
    }

    .panel-back {
        position: relative;
        top: auto;
        left: auto;
        margin: 16px 16px 0 16px;
    }

    .panel-gallery {
        padding: 16px 20px 0 20px;
        margin-bottom: 0;
    }

    .gallery-main {
        width: 100%;
        height: auto;
        aspect-ratio: 450 / 337;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .gallery-thumbnails {
        gap: 10px;
    }

    .gallery-thumb {
        width: 70px;
        height: 52px;
        border-radius: 4px;
    }

    .panel-text {
        padding: 20px 20px 32px 20px;
    }

    .panel-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .panel-description {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .panel-link {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .facility-pin {
        width: 32px;
        height: 32px;
    }

    .facility-marker::before {
        width: 12px;
        height: 12px;
    }
}
