* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    background: #222;
    overscroll-behavior: none;
}

body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

#topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 500;
}

#search-wrap { position: relative; flex: 1 1 240px; min-width: 0; }

#search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d1d9e6;
    font-size: 16px;
    outline: none;
}

#search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    max-height: 50vh;
    overflow-y: auto;
    display: none;
    z-index: 501;
}

.search-result {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result:focus { background: #f0f5ff; }

#panorama {
    flex: 1 1 auto;
    min-height: 0;
    background: #222;
    position: relative;
}

#nav-pad {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 450;
    display: flex;
    gap: 18px;
    perspective: 500px;
}

.nav3d {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #3a9bff 0%, #0078ff 55%, #0059c9 100%);
    box-shadow:
        0 6px 0 #00408f,
        0 12px 22px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.55);
    transform: rotateX(12deg);
    transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.nav3d:hover { filter: brightness(1.08); }
.nav3d:active {
    transform: rotateX(12deg) translateY(5px);
    box-shadow:
        0 1px 0 #00408f,
        0 4px 10px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.4);
}
.nav3d .chev { font-size: 1.7rem; line-height: 1; margin-top: -3px; }

#place-name {
    position: fixed;
    left: 50%;
    top: 78px;
    transform: translateX(-50%) rotateX(12deg);
    z-index: 440;
    max-width: 80vw;
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    text-align: center;
    background: linear-gradient(180deg, #2b3446 0%, #1b2231 55%, #111722 100%);
    box-shadow:
        0 6px 0 #0a0e16,
        0 12px 22px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.35);
    text-shadow: 0 2px 3px rgba(0,0,0,0.6);
}
#place-name[hidden] { display: none; }

.pnlm-panorama-info { display: none !important; }

#minimap-container {
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 320px;
    height: 210px;
    z-index: 400;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.35);
    background: rgba(255,255,255,0.95);
    overflow: hidden;
}
#minimap { width: 100%; height: 100%; }

#mm-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 401;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(20,20,20,0.75);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    display: none;
}

.leaflet-tooltip {
    background: #fff;
    color: #222;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 6px 10px;
}

.marker-active { filter: drop-shadow(0 0 8px #0078ff); }
.marker-hover { filter: drop-shadow(0 0 10px #ff9500) saturate(2); z-index: 999 !important; }

@media (max-width: 700px) {
    #topbar { padding: 8px 10px; gap: 6px 10px; }
    #tour-status { font-size: 0.8rem; }
    #minimap-container {
        width: 74px;
        height: 74px;
        bottom: 88px;
        right: 10px;
        border-radius: 12px;
        transition: width 0.2s, height 0.2s;
    }
    #minimap-container.open {
        width: 86vw;
        height: 52vh;
    }
    #minimap-container:not(.open) #minimap { pointer-events: none; }
    #mm-toggle { display: block; }
    #minimap-container:not(.open) #mm-toggle {
        inset: 0;
        width: 100%;
        height: 100%;
        border-radius: 12px;
        background: rgba(20,20,20,0.35);
        font-size: 1.3rem;
    }
    #nav-pad { bottom: 18px; gap: 12px; }
    .nav3d { padding: 12px 20px; font-size: 0.95rem; }
}

@media (max-height: 450px) {
    #minimap-container { width: 30vw; height: 45vh; }
}
