* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: auto;
    font-family: 'Google Sans', 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body{
    background: #e0e0e0;
     /* background-image: url('../imgs/background-body.webp'); */
     background-image: url('../imgs/cover-2.webp');
    background-position: bottom 20% center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}
body::after {
    content: "";
    z-index: -1;
    width: 100%;
    height: 100%;
    opacity: .1;
    mix-blend-mode: hard-light;
    /* background-image: url(https://lily.elove.space/wp-content/uploads/sites/3/2025/09/noise.gif); */
    background-image: url('../imgs/noise.gif');
    background-position: 0 0;
    background-size: auto;
    position: absolute;
    top: 0;
}
/* Container Layout */
.map-section {
    width: 100%;
    min-height: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;    
}

@media screen and (min-width: 992px) {
    .map-section {
        height: 90vh;
    }
    body {
        display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    }
}

.coppy_right{
margin-top: 3rem;
}
.coppy_right a {
    color: #a7a7a7d9;
    font-size: .9rem;
    text-decoration: none;
    text-transform: uppercase;    
    font-weight: 400;
}

.coppy_right a:hover {
    /* text-decoration: underline; */
    color: #fff;
    font-weight: 600;
}

#debugButton {
    font-family: Google Sans, 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    font-weight: 500;
}

.pattern_1{
    content: '';
    position: absolute;
    width: 16%;
    height: auto;
    aspect-ratio: 4/6;
    top: -7%;
    left: -4%;
    background-image: url('../imgs/trang-tri-1.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}

.infor_subtitle{
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    letter-spacing: -1px;
}
#map-container {
    width: 100%;
    max-width: 1280px;
    height: 100%;
    max-height: 800px;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 300px 1fr;    
    gap: 1.5rem;
    row-gap: 1rem;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

/* Map Navigate - Full width first row */
.map-navigate {
    grid-column: 1 / -1;
    grid-row: 1;        
    border-radius: 8px;    
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;    
}

#the_21km {
    height: auto;
    width: auto;
    max-width: 180px;
    margin: 20px 0 30px 0;
}

.nav-left {
    justify-self: start;
}

.nav-center {
    justify-self: center;
    display: flex;
    align-items: center;
}

.nav-right {
    justify-self: end;
}

.logo {
    height: 100px;
    width: auto;    
}
.divider {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 12px 0;
    display: flex
}

/* Map Info Panel - Left column, second row */
.map-infor {
    grid-column: 1;
    grid-row: 2;
    background: rgb(255 255 255 / 85%);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.top-infor p{
    line-height: 1.5;
    margin: 6px 0 4px 0;
}

img.note_img {
    width: 100%;
    height: auto;       
    max-width:140px;
}

/* Map Wrapper - Right column, second row */
.map-wrapper {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    border-radius: 8px;
    /* overflow: hidden; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

}

/* Map Styles */
#map {
    width: 100%;
    height: calc(100% - 0px);
    border-radius: 12px;
    position: relative;
    background: #fff;
}

/* Map Frame Overlay */
.map-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    /* background-image: url('../imgs/frame-21.webp'); */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Map Info Panel - Removed duplicate, already defined above */

.map_action {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1;
}

/* Start Button */
.start-button {
    padding: 10px 20px;
    background: #AF0011;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-family: Google Sans, 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
}

.start-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(90deg, 
        transparent,
        transparent,
        #FFD700,
        #FFA500,
        #FFD700,
        transparent,
        transparent
    );
    background-size: 200% 100%;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRun 2s linear infinite;
}

@keyframes borderRun {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.start-button:hover {
    box-shadow: 0 4px 12px rgba(175, 0, 17, 0.4);
    transform: translateY(-2px);
}

/* Runner Marker */
.runner-marker {
    width: 40px;
    height: 40px;
    background-image: url('../imgs/icon_shoe.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transform-origin: center center;
    transition: transform 0.1s linear;
    will-change: transform;
    border-radius: 50%;
    background-color: #1618F7;
    border: solid 3px #fff;
}


.mapboxgl-popup {
    border-radius: 12px;
    /* display: none; */
}

/* Station Popup Styles */
body .goongjs-popup-content,
.mapboxgl-popup-content {
    background: #FFFFFF !important;
    border-radius: 12px !important;
    padding: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Google Sans', Arial, sans-serif !important;
    max-width: 300px !important;
}

.goongjs-popup.station-popup-container .goongjs-popup-tip {
    border-top-color: #FFFFFF !important;
}

.goongjs-popup.station-popup-container .goongjs-popup-close-button {
    font-size: 20px !important;
    padding: 8px !important;
    color: #666 !important;
    right: 4px !important;
    top: 4px !important;
}

.goongjs-popup.station-popup-container .goongjs-popup-close-button:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #333 !important;
}

.station-popup {
    padding: 10px !important;
    min-width: 160px !important;
}

.mapboxgl-popup-close-button {
    position: absolute;    
    border: 0;
    border-radius: 0 3px 0 0;
    cursor: pointer;
    background-color: transparent;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #af0011;
    display: flex;
    align-items: center;
    justify-content: center;    
}

.service-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 6px !important;
    transition: background-color 0.2s ease !important;
    border-radius: 6px !important;
}

.service-item:hover {
    background-color: rgba(22, 24, 247, 0.05) !important;
}

.service-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.service-icon {
    font-size: 22px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.service-label {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #333 !important;
    line-height: 1.4 !important;
}

/* Station Markers - keep for reference */
.station-marker-dot {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Old station marker styles - keep for reference */
.station-marker {
    width: 16px;
    height: 16px;
    background-color: #FFD700;
    border: 2px solid #FFF;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.station-marker:hover {
    transform: scale(1.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* Station Popup */
.goongjs-popup.station-popup-container .goongjs-popup-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    font-family: 'Google Sans', sans-serif;
}

.goongjs-popup.station-popup-container .goongjs-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.98);
}

.station-popup {
    padding: 10px 12px;
    min-width: 150px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.service-item:hover {
    background-color: rgba(22, 24, 247, 0.05);
}

.service-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.service-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.service-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .map-section {
        padding: 15px;
    }

    #map-container {
        max-height: 600px;
        grid-template-columns: 250px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .map-navigate {
        padding: 12px 16px;
        font-size: 14px;
    }

    .map-infor {
        padding: 16px;
        font-size: 14px;
    }

    .runner-marker {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    body, html {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .map-section {
        min-height: 100vh;
        padding: 10px;
        align-items: flex-start;
    }

    #map-container {
        height: auto;
        min-height: calc(100vh - 20px);
        max-height: none;
        grid-template-rows: auto auto 1fr;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .map-navigate {
        grid-column: 1;
        grid-row: 1;
        padding: 12px 16px;
        font-size: 14px;
        gap: 12px;
    }

    .logo {
        height: 60px;
    }

    #the_21km {
        max-width: 140px;
        margin: 15px 0 8px 0;
    }

    .map-infor {
        grid-column: 1;
        grid-row: 2;
        padding: 16px;
        font-size: 13px;
        overflow-y: auto;
        max-height: none;
    }

    .top-infor h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .top-infor p {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .note_infor {
        margin-top: 16px;
    }

    .note_img {
        max-width: 100%;
        height: auto;
    }

    .map-wrapper {
        grid-column: 1;
        grid-row: 3;
        min-height: 400px;
        height: 50vh;
    }

    #map {
        height: 100%;
        min-height: 400px;
    }

    .map_action {
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    .start-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .runner-marker {
        width: 35px;
        height: 35px;
    }

    /* Station markers smaller on mobile */
    .start-line-marker {
        width: 30px !important;
        height: 30px !important;
    }

    /* Popup adjustments for mobile */
    .station-popup {
        min-width: 140px !important;
        padding: 8px !important;
    }

    .service-item {
        padding: 6px 4px !important;
        gap: 8px !important;
    }

    .service-icon {
        font-size: 18px !important;
    }

    .service-label {
        font-size: 13px !important;
    }
}

/* Loading State */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    text-align: center;
    color: #666;
}
