:root {
    --green: #95e246;
    --black: #000000;
    --white: #ffffff;
    --transition-speed: 0.3s;
    --light-gray: #f0f0f0;
    --nav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.game-container {
    width: 100%;
    height: calc(100vh - var(--nav-height));
    margin-top: var(--nav-height);
    overflow: hidden;
    position: fixed;
    background: var(--white);
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--black);
    padding: 8px 12px;
    z-index: 1000;
    width: 100%;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    width: 100%;
}

.nav-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--green);
    white-space: nowrap;
}

.nav-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    -ms-overflow-style: none;
    margin-inline-start: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.nav-controls::-webkit-scrollbar {
    display: none;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid var(--green);
    border-radius: 4px;
    background: var(--green);
    color: var(--black);
    cursor: pointer;
    transition: var(--transition-speed);
    font-size: 0.85em;
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
}

.nav-button:hover {
    background: #7cc337;
    color: var(--black);
}

.nav-button.active {
    background:  #5b9a1c;
}

@media screen and (max-width: 768px) {
    .nav-content {
        gap: 8px;
    }
    
    .nav-title {
        font-size: 1.1em;
    }
    
    .nav-button {
        padding: 6px 8px;
        font-size: 0.8em;
    }
    
    .nav-button i {
        margin-right: 4px;
    }
}

@media screen and (max-width: 480px) {
    .nav-button span {
        display: none;
    }
    
    .nav-button i {
        margin: 0;
        font-size: 1.1em;
    }
    
    .nav-button {
        padding: 6px;
        min-width: 32px;
        justify-content: center;
    }
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
}
/* added dark mode 7b7b7b */

.darkmode {
    background-color: #2b2b2b !important;
    
}

.darkmode2 {
    background: #3b3b3b !important;
    color: #ffffff;
    
}

.darkmode3 {
    background-color: rgba(59, 59, 59, 0.95) !important;
    color: #ffffff;
}

.darkmode4 {
    background-color: #000000 !important;
}

.darkmode5 {
    color: #d4d4d4 !important;
}

.darkmodeinverse {
    background: rgb(255, 255, 255) !important;  /* dark translucent background */
    color: #000000 !important;  
}

@media screen and (max-width: 768px) {
    .darkmode4 {
        background-color: rgba(59, 59, 59, 0.95) !important;
        color: #ffffff;
    }
}

/* Legend Panel */
.legend-panel {
    position: absolute;
    top: calc(var(--nav-height) + 20px);
    left: 20px;
    width: min(250px, calc(100% - 40px));
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(-120%);
    transition: transform var(--transition-speed), box-shadow 0.3s;
    z-index: 1000;
}

.legend-panel.active {
    transform: translateX(0);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: none;
}

.legend-content {
    padding: 20px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.legend-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--black);
}

/* Location Info Sidebar */
.location-sidebar {
    position: absolute;
    top: calc(var(--nav-height) + 20px);
    right: 20px;
    width: min(300px, calc(100% - 40px));
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    transition: transform var(--transition-speed), box-shadow 0.3s;
    z-index: 1000;
}

.location-sidebar.active {
    transform: translateX(0);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: none;
    background: var(--white);
    color: var(--black);
}

.sidebar-content {
    padding: 20px 0;
    color: var(--black);
}

.sidebar-footer {
    padding: 15px 0;
    background: rgba(149, 226, 70, 0.15);
    border-radius: 0 0 8px 8px;
    font-size: 0.9em;
    color: var(--black);
}

/* Mini Stats */
.mini-stats {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    background: var(--white);
    padding: 10px 15px;
    border: 1px solid var(--black);
    border-radius: 4px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--black);
}

/* Close Button */
.close-button {
    background: var(--green);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--black);
    transition: var(--transition-speed);
}

.close-button:hover {
    background: #7cc337;
}

/* Legend Colors */
.legend-color.academic { background-color: rgba(0, 0, 255, 0.2); }
.legend-color.grass { background-color: rgba(0, 255, 0, 0.2); }
.legend-color.hostel { background-color: rgba(255, 165, 0, 0.2); }
.legend-color.mess { background-color: rgba(255, 0, 0, 0.2); }
.legend-color.parking { background-color: rgba(128, 128, 128, 0.2); }
.legend-color.sports { background-color: rgba(147, 112, 219, 0.2); }
.legend-color.shops { background-color: rgba(255, 140, 0, 0.2); }
.legend-color.temple { background-color: rgba(139, 69, 19, 0.2); }
.legend-color.tree { background-color: rgba(34, 139, 34, 0.8); }
.legend-color.walkways { background-color: #8B4513; }
.legend-color.circles { background-color: rgba(169, 169, 169, 0.2); }
.legend-color.roads-main { background-color: #333333; }
.legend-color.roads-second { background-color: #666666; }
.legend-color.under-construction { 
    background-color: rgba(255, 255, 0, 0.2);
    border: 2px dashed #FFD700;
}

/* Scale Bar */
.ol-scale-line {
    position: absolute;
    bottom: 15px;
    left: 20px;
    background: var(--white);
    border: 1px solid var(--black);
    border-radius: 4px;
    padding: 5px 10px;
    color: var(--black);
    font-size: 12px;
    z-index: 1000;
}

.ol-scale-line-inner {
    border: 2px solid var(--green);
    border-top: none;
    color: var(--black);
}

/* North Arrow */
.north-arrow {
    position: absolute;
    top: calc(var(--nav-height) - 30px);
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--green);
    z-index: 1000;
    transition: box-shadow 0.3s;
}

.north-arrow::after {
    content: "N";
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: var(--green);
    margin-top: 2px;
}

.north-arrow:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
/* Copyright Notice */
.copyright-notice {
    position: absolute;
    bottom: 2px; 
    right: 10px; 
    color: var(--black);
    font-size: 10px; 
    font-weight: 500;
    z-index: 1000;
    transition: color var(--transition-speed);
}
/* Event Popup */
.event-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    padding: 20px;
}

.event-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}


.event-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.event-popup-title {
    margin: 0;
    font-size: 1.5em;
    text-align: center;
}

.event-popup-close, .event-popup-back {
    background: var(--green);
    color: var(--black);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.event-popup-close:hover, .event-popup-back:hover {
    background: #7cc337;
}

.event-list, .event-details {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.event-popup.active .event-list,
.event-popup.active .event-details {
    opacity: 1;
    transform: translateY(0);
}

.event-list-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.event-list-item:hover {
    background: rgba(128, 128, 128, 0.1);
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.zoom-button, .rotate-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--black);
    transition: var(--transition-speed);
}

.zoom-button:hover, .rotate-button:hover {
    background: var(--green);
    color: var(--black);
}

.rotate-button {
    margin-top: 10px;
}

.rotate-left {
    order: 3;
}

.rotate-right {
    order: 4;
}

.reset-rotation {
    order: 5;
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.control-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--black);
    transition: var(--transition-speed);
}

.control-button:hover {
    background: var(--light-gray);
    transform: scale(1.05);
}

.control-button:active {
    transform: scale(0.95);
}


/* toggle button css */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    z-index: 2;
}

.slider i {
    position: absolute;
    left: 17px;
    bottom: 17px;
    transform: translate(-50%, 50%);
    font-size: 14px;
    color: #333;
    z-index: 3;
    pointer-events: none;
    transition: transform 0.4s;
}

input:checked + .slider {
    background-color: var(--green);
}

input:focus + .slider {
    box-shadow: 0 0 1px #7cc337;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:checked + .slider i {
    transform: translate(19px, 50%);
}

/*hamburger*/
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    margin: 10px;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--green);
    margin: 5px 0;
    transition: .3s;
    display: block;
}

@media screen and (max-width: 768px) {
    .hamburger-btn {
        display: inline-block;
        z-index: 1000;
    }

    .nav-controls {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 50px;
        right: 10px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0,0,0,0.2);
        padding: 10px;
        z-index: 999;
    }

    .nav-controls.menu-open {
        display: flex;
    }

    .nav-button {
        width: 100%;
        text-align: left;
        padding: 8px 12px;
    }

    .switch {
        align-self: flex-start;
        margin-top: 8px;
    }
    .map-controls {
    bottom: 15%;
    }
    .ol-scale-line {
    bottom: 12%;
    }
}

#darkToggleContainer {
    order: 2;
}

.hamburger-btn {
    order: 1;
}

/*for dark toggle appearing before hamburger */
@media screen and (max-width: 768px) {
    #darkToggleContainer {
        order: 0;
        margin-inline-start: auto;
    }

    .hamburger-btn {
        order: 1;
    }
     .map-search-container {
        top:14px;
    }
}

.map-wrap{
    position: absolute;
    top: 10px;
    left: 40%;
    transform: translateX(-40%);
    display: flex;
    width: max(223px,50%);
    max-width: 90%;
    align-self: flex-end;
    justify-content: center;
    padding-right: 80px;
    opacity: 100%;
}

.map-search-container {
    position: absolute;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: inherit;
    max-width: 90%;
    left: 10px;
}

.map-search-container input {
    border: none;
    outline: none;
    font-size: 14px;
    padding: 6px 8px;
    flex: 1;
    border-radius: 30px;
    background: transparent;
}

.map-search-container i {
    color: #555;
    margin-left: 8px;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .map-wrap {
        position: absolute;
        top: 65px;
        width: 100%;
        left: 50%;
    }
    .map-search-container{
        height: auto;
    }
    .north-arrow{
        top: calc(var(--nav-height) - 43px);
        left: 10px;
    }
}
.search-results {
    top: 46px;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: absolute;
    z-index: 1001;
    width: 100%;
    left: 0px;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background-color: #f2f2f2;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 30%;
    width: 40%;
    min-height: 20%;
    max-height: 30%;
    background: rgba(221, 220, 220, 0.95);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
    transition: bottom 0.3s ease;
    z-index: 2000;
    padding-bottom: 20px;
}

@media screen and (max-width: 768px) {
    .bottom-sheet {
        width: 100%;
        left: 0;
        
    }
}

.bottom-sheet.active {
    bottom: 0;
}

.sheet-header {
    border-radius: 15px;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    background: #f0f0f0;
    border-bottom: 1px solid #696969;
    width: 90%;
    left: 5% !important;
    position: relative;
    bottom: 20px;
}

.sheet-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    gap: 10px; /* Consistent spacing */
    margin-top: 10px; /* Separate from description */
    flex-wrap: nowrap; /* Prevent wrapping */
    margin-bottom: 10px
}

.sheet-content p {
    font-size: 14px;
    margin: 10px 0;
    text-align: center;
}

#selectedPlace {
    font-weight: bold;
    font-size: 16px;
    align-self: center;
    text-align: center;
}

#startNavigationBtn, .detail-button, #followRouteBtn {
    padding: 10px 15px;

    font-size: 15px;
    line-height: 1; /* Normalize line-height */
    background: var(--green);
    color: var(--black);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-width: 100px;
    text-align: center;
    transition: background 0.2s ease;
    display: inline-flex; /* Ensure consistent alignment */
    align-items: center;
    justify-content: center;
    vertical-align: middle; /* Prevent baseline issues */
}

#startNavigationBtn:hover, .detail-button:hover, #followRouteBtn:hover {
    background: #7cc337;
}

@media screen and (max-width: 768px) {
    .hide{
        display: none;
    }
}


/*rainfall effect*/

.rain {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
    filter: invert(1);
}

.rain.back-row {
    z-index: 1;
    bottom: 60px;
    opacity: 0.5;
}

.drop {
    top:60px;
    position: absolute;
    bottom: 100%;
    width: 15px;
    height: 120px;
    animation: drop 0.5s linear infinite;
}

@keyframes drop {
    0% { transform: translateY(0); }
    75%, 100% { transform: translateY(80vh); }
}

.stem {
    width: 1px;
    height: 60%;
    margin-left: 7px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.25));
    animation: stem 0.5s linear infinite;
}

@keyframes stem {
    0%, 65% { opacity: 1; }
    75%, 100% { opacity: 0; }
}

.splat {
    width: 15px;
    height: 10px;
    border-top: 2px dotted rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    opacity: 1;
    transform: scale(0);
    animation: splat 0.5s linear infinite;
}

@keyframes splat {
    0%, 80% { opacity: 1; transform: scale(0); }
    90% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

.rainbackground{
    filter: invert(0);
}

/*mini popup*/
.mini-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, bottom 0.4s ease;
    z-index: 1100;
    backdrop-filter: blur(4px);

    width: fit-content;
    text-align: center;
}

.mini-popup.active {
    opacity: 80%;
    bottom: 50px;
    pointer-events: auto;
}

.location-notification {
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1100;
    text-align: center;
    max-width: 80%;
    pointer-events: none;
    animation: fadeInOut 5s forwards;
    opacity: 0;
}
@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.route-popup {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(0, 0, 0);
    backdrop-filter: blur(4px);
    border-radius: 30px;
    padding: 8px;
    z-index: 1001;
    color: white;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease-in-out;
    height: 46px;
    opacity: 80%;
    z-index: auto;
    transition: opacity 0.4s ease, bottom 0.4s ease;
}

@media screen and (min-width: 768px) {
    .route-popup{
        top: 80px;
    }
}

.route-popup-content {
    text-align: center;
    font-family: sans-serif;
    margin-top: 2%;
    max-width: 100%;
}

#closeRoutePopup {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: transparent;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.hidden {
    display: none;
}



.feedback-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.feedback-content {
    background: #ffffffe3;
    bottom: 60px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.feedback-content textarea {
    width: 100%;
    height: 100px;
    margin-top: 10px;
    padding: 10px;
    resize: none;
    border-radius: 15px;
    margin-bottom: 10px;
}


.hidden {
    display: none;
}

.social-icons {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    font-size: 2rem;
    z-index: 10;
}

.social-icons a {
    color: var(--green);
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #1e90ff; /* Dodger blue hover */
}

/* In styles.css, after .event-popup styles */
.detail-popup {
    position: absolute; /* Revert to absolute for centered popup */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8); /* Initial scale for animation */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2000; /* Match bottom-sheet z-index */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s; /* Smooth transition */
    padding: 20px;
}

.detail-popup.darkmode3 {
    background: rgba(59, 59, 59, 0.95) !important;
    color: #ffffff;
}

.detail-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1); /* Scale to full size */
}

.detail-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.detail-popup-title {
    margin: 0;
    font-size: 1.5em;
    text-align: center;
    font-weight: bold;
}

.detail-popup-close {
    background: var(--green);
    color: var(--black);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.detail-popup-close:hover {
    background: #7cc337;
}

.building-content {
    opacity: 1; /* Remove animation to prevent jitter */
    transition: none;
}

.building-images img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

/* In styles.css, after .building-description */
.building-images {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 10px 0;
}

.image-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 10px;
    scrollbar-width: none; /* Hide scrollbar in Firefox */
}

.image-carousel::-webkit-scrollbar {
    display: none; /* Hide scrollbar in Chrome/Safari */
}

.carousel-image {
    flex: 0 0 auto;
    width: 150px; /* Thumbnail size */
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.carousel-image:hover {
    transform: scale(1.05);
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000; /* Above all popups */
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--green);
    color: var(--black);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-nav:hover {
    background: #7cc337;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--green);
    color: var(--black);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: #7cc337;
}

/* Support dark mode */
.lightbox.darkmode3 .lightbox-nav,
.lightbox.darkmode3 .lightbox-close {
    background: #7cc337; /* Lighter green for contrast */
}

/* Ensure existing styles remain */
.building-description {
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0;
}




@media screen and (max-width: 768px) {
    .detail-popup {
        width: 90%;
        padding: 15px;
    }
    .sheet-buttons {
        flex-direction: column; /* Stack buttons on mobile for better spacing */
        gap: 8px;
    }
    #startNavigationBtn, .detail-button, #followRouteBtn {
        min-width: 80%; /* Wider buttons on mobile */
    }
}

/* Update bottom-sheet for dark mode */
.bottom-sheet.darkmode3 {
    background: rgba(59, 59, 59, 0.95) !important;
    color: #ffffff;
}