/* ============================================
   360 VIRTUAL TOUR STYLES
   Uses vars from global.css
   ============================================ */

/* Tour viewer: fully immersive — nuke everything else */
html:has(#tour-wrapper),
body:has(#tour-wrapper) {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    background-image: none;
}

body:has(#tour-wrapper) #navbar,
body:has(#tour-wrapper) #footer {
    display: none !important;
}

/* === TOUR VIEWER LAYOUT === */
#tour-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

/* === LOGO BUTTON (top-left) === */
#tour-logo-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#tour-logo-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#tour-logo-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 24px rgba(253, 173, 1, 0.35);
}

/* === INFO BUTTON (next to logo) === */
#tour-info-btn {
    position: absolute;
    top: 22px;
    left: 78px;
    z-index: 10;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

#tour-info-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

#tour-info-btn:hover {
    border-color: rgba(253, 173, 1, 0.4);
    background: rgba(253, 173, 1, 0.1);
}

#tour-info-btn:hover svg {
    color: var(--primary-color);
}

/* === INFO BUTTON NUDGE TOOLTIP === */
#info-nudge {
    position: absolute;
    top: 68px;
    left: 78px;
    z-index: 12;
    white-space: nowrap;
    padding: 10px 16px;
    background: rgba(18, 18, 18, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(253, 173, 1, 0.4);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 20px rgba(253, 173, 1, 0.1);
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#info-nudge.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Arrow pointing up to the info button */
#info-nudge::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 18px;
    width: 12px;
    height: 12px;
    background: rgba(18, 18, 18, 0.88);
    border-top: 1px solid rgba(253, 173, 1, 0.4);
    border-left: 1px solid rgba(253, 173, 1, 0.4);
    transform: rotate(45deg);
}

#info-nudge .nudge-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

#info-nudge .nudge-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

#info-nudge .nudge-dismiss {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid rgba(253, 173, 1, 0.3);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#info-nudge .nudge-dismiss:hover {
    background: rgba(253, 173, 1, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Glow pulse on the info button when nudge is active */
#tour-info-btn.nudge-active {
    animation: info-btn-glow 2s ease-in-out infinite;
    border-color: rgba(253, 173, 1, 0.5);
}

#tour-info-btn.nudge-active svg {
    color: var(--primary-color);
}

@keyframes info-btn-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(253, 173, 1, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(253, 173, 1, 0.45);
    }
}

/* === PROPERTY INFO OVERLAY === */
#tour-info-scrim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 29;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#tour-info-scrim.visible {
    opacity: 1;
    pointer-events: auto;
}

#tour-info-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 30;
    width: 340px;
    max-width: calc(100vw - 40px);
    padding: 32px 28px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

#tour-info-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

#tour-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#tour-info-close svg {
    width: 16px;
    height: 16px;
}

#tour-info-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
}

#tour-info-headshot-wrap {
    margin: 0 auto 16px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 24px rgba(253, 173, 1, 0.2);
}

#tour-info-headshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#tour-info-realtor-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tour-info-property {
    font-size: 0.85rem;
    color: var(--primary-color);
    margin: 0 0 20px;
    font-weight: 500;
}

#tour-info-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tour-info-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tour-info-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--primary-color);
}

.tour-info-link:hover {
    background: rgba(253, 173, 1, 0.08);
    border-color: rgba(253, 173, 1, 0.3);
    color: var(--text-color);
}

#tour-viewer {
    width: 100%;
    height: 100%;
}

/* Hide PSV default navbar */
#tour-viewer .psv-navbar {
    display: none !important;
}

/* === GLASSMORPHIC PANEL BASE === */
.tour-glass {
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: var(--text-color);
    font-family: 'Lato', sans-serif;
}

/* === ROOM LIST PANEL (LEFT SIDEBAR) === */
/* === BOTTOM INFO BAR === */
#info-bar {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
    max-width: calc(100% - 40px);
}

#current-room-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
}

#room-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* === ROOM CAROUSEL (bottom — all viewports) === */
#room-carousel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 14px 0 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 70%, transparent 100%);
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.25s ease;
}

#room-carousel.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

#carousel-track {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
}

#carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex-shrink: 0;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
    opacity: 0.55;
    width: 90px;
}

.carousel-item img {
    width: 86px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.carousel-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 86px;
    text-align: center;
}

.carousel-item.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.carousel-item.active .carousel-label {
    color: var(--primary-color);
}

.carousel-item:hover {
    opacity: 0.85;
}

.carousel-item.active:hover {
    opacity: 1;
}

.carousel-item:active {
    transform: scale(0.95);
}

/* === CAROUSEL TOGGLE BUTTON === */
#carousel-toggle-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 11;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease, bottom 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

#carousel-toggle-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.2s ease;
}

#carousel-toggle-btn:hover {
    border-color: rgba(253, 173, 1, 0.4);
    background: rgba(253, 173, 1, 0.1);
}

#carousel-toggle-btn:hover svg {
    color: var(--primary-color);
}

/* Chevron flips up when carousel is visible */
#room-carousel:not(.hidden)~#carousel-toggle-btn svg {
    transform: rotate(180deg);
}

/* Button moves up when carousel is showing */
#room-carousel:not(.hidden)~#carousel-toggle-btn {
    bottom: 96px;
}

/* === TOP-RIGHT CONTROLS === */
#tour-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    gap: 6px;
    padding: 6px;
}

#tour-controls button {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

#tour-controls button:hover {
    background: rgba(253, 173, 1, 0.12);
    border-color: rgba(253, 173, 1, 0.4);
    color: var(--primary-color);
}

#tour-controls button.active {
    background: rgba(253, 173, 1, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#tour-controls button svg {
    width: 18px;
    height: 18px;
}

/* === AUTOTOUR BUTTON === */
#btn-autotour {
    position: relative;
    overflow: visible;
    border: none !important;
    background: none !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
}

#btn-autotour .autotour-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 42px;
    height: 42px;
    transform: rotate(-90deg);
}

#btn-autotour .ring-track {
    stroke: rgba(255, 255, 255, 0.08);
}

#btn-autotour .ring-progress {
    stroke: var(--primary-color);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s linear;
}

#btn-autotour .autotour-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#btn-autotour .autotour-play {
    transform: translate(-46%, -50%);
}

#btn-autotour .autotour-pause {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
}

#btn-autotour.active .autotour-play {
    opacity: 0;
    transform: translate(-46%, -50%) scale(0.6);
}

#btn-autotour.active .autotour-pause {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#btn-autotour.active .ring-track {
    stroke: rgba(253, 173, 1, 0.15);
}

#btn-autotour:hover .ring-track {
    stroke: rgba(253, 173, 1, 0.2);
}

#btn-autotour:hover .autotour-icon {
    color: var(--primary-color);
}

/* === PSV VIRTUAL TOUR ARROW OVERRIDES === */
.psv-virtual-tour-link {
    cursor: pointer !important;
}

/* PSV tooltip styling for arrow labels */
.psv-virtual-tour-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 4px 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.psv-virtual-tour-tooltip::after {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* === FLOOR HOTSPOT BUTTONS === */
.floor-hotspot {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 4px 12px rgba(253, 173, 1, 0.3));
    user-select: none;
    -webkit-user-select: none;
    animation: hotspot-fade-in 0.35s ease-out both;
}

.floor-hotspot.hotspot-fade-out {
    animation: hotspot-fade-out 0.25s ease-in both;
    pointer-events: none;
}

@keyframes hotspot-fade-in {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

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

@keyframes hotspot-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

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

.floor-hotspot-pulse {
    position: absolute;
    width: 64px;
    height: 64px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(253, 173, 1, 0.4);
    animation: hotspot-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

.floor-hotspot-inner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 0 20px rgba(253, 173, 1, 0.2);
}

.floor-hotspot:hover .floor-hotspot-inner {
    transform: scale(1.18);
    box-shadow: 0 0 30px rgba(253, 173, 1, 0.45);
    background: rgba(253, 173, 1, 0.15);
}

.floor-hotspot-inner svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    transition: transform 0.25s ease;
}

.floor-hotspot:hover .floor-hotspot-inner svg {
    transform: translateY(-2px);
}

.floor-hotspot-label {
    position: absolute;
    top: calc(100% + 6px);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.floor-hotspot:hover .floor-hotspot-label {
    opacity: 1;
    transform: translateY(0);
}

/* === VIEWPOINT (CAMERA) HOTSPOT VARIANT === */
.viewpoint-hotspot .floor-hotspot-pulse {
    border-color: rgba(0, 217, 255, 0.4);
}

.viewpoint-hotspot .floor-hotspot-inner {
    border-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.viewpoint-hotspot .floor-hotspot-inner svg {
    fill: var(--secondary-color);
}

.viewpoint-hotspot:hover .floor-hotspot-inner {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.45);
    background: rgba(0, 217, 255, 0.15);
}

.viewpoint-hotspot {
    filter: drop-shadow(0 4px 12px rgba(0, 217, 255, 0.3));
}

@keyframes hotspot-pulse {

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

    50% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

/* === LOADING OVERLAY === */
#tour-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
    transition: opacity 0.5s ease;
}

#tour-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(253, 173, 1, 0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 16px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Force hide built-in PSV loader */
.psv-loader {
    display: none !important;
}

/* === ERROR STATE === */
.tour-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 48px;
    max-width: 400px;
}

.tour-error h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0 0 12px;
    text-transform: uppercase;
}

.tour-error p {
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 14px;
}

.tour-error a {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color);
    color: #121212;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tour-error a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(253, 173, 1, 0.3);
}

/* === MOBILE STYLES === */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {

    /* iOS: extend into safe areas for true edge-to-edge */
    #tour-wrapper {
        top: env(safe-area-inset-top, 0px);
        left: 0;
        right: 0;
        bottom: 0;
    }

    .mobile-only {
        display: flex !important;
    }

    /* Logo button — top-left, respects safe area */
    #tour-logo-btn {
        top: calc(8px + env(safe-area-inset-top, 0px));
        left: calc(8px + env(safe-area-inset-left, 0px));
        width: 42px;
        height: 42px;
    }

    /* Info button — next to logo */
    #tour-info-btn {
        top: calc(11px + env(safe-area-inset-top, 0px));
        left: calc(58px + env(safe-area-inset-left, 0px));
        width: 36px;
        height: 36px;
    }

    #info-nudge {
        top: calc(54px + env(safe-area-inset-top, 0px));
        left: calc(12px + env(safe-area-inset-left, 0px));
        font-size: 12px;
        padding: 9px 14px;
    }

    #info-nudge::before {
        left: calc(52px - env(safe-area-inset-left, 0px));
    }

    #tour-info-overlay {
        width: calc(100vw - 32px);
        padding: 28px 20px;
    }

    /* Controls — top-right, respects safe area */
    #tour-controls {
        top: calc(8px + env(safe-area-inset-top, 0px));
        right: calc(8px + env(safe-area-inset-right, 0px));
        padding: 4px;
        gap: 4px;
    }

    #tour-controls button {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    #tour-controls button svg {
        width: 16px;
        height: 16px;
    }

    #btn-autotour {
        width: 38px !important;
        height: 38px !important;
    }

    #btn-autotour .autotour-ring {
        width: 38px;
        height: 38px;
    }

    #btn-autotour .autotour-icon {
        width: 14px;
        height: 14px;
    }

    /* Hide desktop-only elements on mobile */
    #info-bar {
        display: none !important;
    }

    /* Mobile carousel adjustments */
    #room-carousel {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    #carousel-track {
        gap: 8px;
        padding: 0 12px;
    }

    .carousel-item {
        width: 76px;
    }

    .carousel-item img {
        width: 72px;
        height: 46px;
    }

    .carousel-label {
        max-width: 72px;
        font-size: 9px;
    }

    #carousel-toggle-btn {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
        width: 38px;
        height: 38px;
    }

    #room-carousel:not(.hidden)~#carousel-toggle-btn {
        bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    }

    /* Larger tap targets for hotspots on touch */
    .floor-hotspot-inner {
        width: 52px;
        height: 52px;
    }

    .floor-hotspot-inner svg {
        width: 24px;
        height: 24px;
    }

    .floor-hotspot-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .floor-hotspot-inner {
        width: 46px;
        height: 46px;
    }

    .floor-hotspot-inner svg {
        width: 22px;
        height: 22px;
    }
}

/* ============================================
   EDITOR STYLES
   ============================================ */

#editor-wrapper {
    display: flex;
    height: calc(100vh - 77px);
    height: calc(100dvh - 77px);
    overflow: hidden;
    background: var(--dark-bg);
}

#editor-viewer-container {
    flex: 1;
    position: relative;
    min-width: 0;
}

#editor-viewer {
    width: 100%;
    height: 100%;
}

#editor-viewer .psv-navbar {
    display: none !important;
}

/* Crosshair overlay for placement mode */
#editor-crosshair {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    display: none;
}

#editor-crosshair.active {
    display: block;
}

/* Cursor on the viewer container when in placement mode */
#editor-viewer-container.placement-mode {
    cursor: crosshair;
}

#editor-viewer-container.placement-mode canvas {
    cursor: crosshair !important;
}

#editor-crosshair::before,
#editor-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(253, 173, 1, 0.4);
}

#editor-crosshair::before {
    width: 1px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#editor-crosshair::after {
    width: 24px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Editor config panel */
#editor-panel {
    width: 380px;
    flex-shrink: 0;
    border-left: 1px solid var(--glass-border);
    background: rgba(18, 18, 18, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.editor-panel-header h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
}

.editor-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.editor-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-tab:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.03);
}

.editor-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.editor-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.editor-tab-content::-webkit-scrollbar {
    width: 4px;
}

.editor-tab-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.editor-tab-pane {
    display: none;
}

.editor-tab-pane.active {
    display: block;
}

/* Editor form elements */
.editor-field {
    margin-bottom: 18px;
}

.editor-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.editor-field input[type="text"],
.editor-field select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.editor-field input[type="text"]:focus,
.editor-field select:focus {
    outline: none;
    border-color: rgba(253, 173, 1, 0.5);
}

.editor-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d0d0d0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.editor-field select option {
    background: #1e1e1e;
    color: var(--text-color);
}

/* Room list in editor */
.editor-room-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.editor-room-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.editor-room-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.editor-room-item.selected {
    background: rgba(253, 173, 1, 0.1);
    border-color: rgba(253, 173, 1, 0.3);
}

.editor-room-item.default-scene::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary-color);
    flex-shrink: 0;
}

.editor-room-item img {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.editor-room-item .room-info {
    flex: 1;
    min-width: 0;
}

.editor-room-item .room-info .room-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-room-item .room-info .room-file {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
}

.editor-room-item.drag-over-top {
    border-top: 2px solid var(--primary-color);
}

.editor-room-item.drag-over-bottom {
    border-bottom: 2px solid var(--primary-color);
}

.editor-room-item .room-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.editor-room-item .room-actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.editor-room-item .room-actions button:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
    color: var(--text-color);
}

.editor-room-item .room-actions button.delete:hover {
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
}

.editor-room-item .room-actions button.set-default-view.has-view {
    color: var(--secondary-color);
}

.editor-room-item .room-actions button.set-default-view:hover {
    color: var(--secondary-color);
    border-color: rgba(0, 217, 255, 0.3);
    background: rgba(0, 217, 255, 0.08);
}

/* Hotspot list in editor */
.editor-hotspot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}

.editor-hotspot-item .hs-info {
    font-size: 13px;
}

.editor-hotspot-item .hs-target {
    color: var(--primary-color);
    font-weight: 500;
}

.editor-hotspot-item .hs-coords {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 2px;
}

.editor-hotspot-item button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.editor-hotspot-item button:hover {
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
}

/* Hotspot type badges */
.hs-type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.hs-type-badge.navigation {
    background: rgba(253, 173, 1, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(253, 173, 1, 0.3);
}

.hs-type-badge.viewpoint {
    background: rgba(0, 217, 255, 0.12);
    color: var(--secondary-color);
    border: 1px solid rgba(0, 217, 255, 0.3);
}

/* Editor buttons */
.editor-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-btn-primary {
    background: var(--primary-color);
    color: #121212;
}

.editor-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(253, 173, 1, 0.3);
}

.editor-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.editor-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.editor-btn-accent {
    background: rgba(0, 217, 255, 0.12);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: var(--secondary-color);
}

.editor-btn-accent:hover {
    background: rgba(0, 217, 255, 0.2);
}

.editor-btn-accent.active {
    background: rgba(0, 217, 255, 0.25);
    box-shadow: 0 0 16px rgba(0, 217, 255, 0.2);
}

.editor-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Hotspot placement mode indicator */
#placement-indicator {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    padding: 8px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary-color);
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    display: none;
}

#placement-indicator.active {
    display: block;
    animation: placement-blink 2s ease-in-out infinite;
}

@keyframes placement-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Coordinate display on click */
#coord-display {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 15;
    padding: 10px 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--secondary-color);
    min-width: 180px;
}

#coord-display .coord-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Toast notification */
.tour-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 1000;
    padding: 12px 24px;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.tour-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tour-toast.success {
    border-color: rgba(46, 213, 115, 0.4);
    color: #2ed573;
}

.tour-toast.error {
    border-color: rgba(255, 71, 87, 0.4);
    color: #ff4757;
}

/* Add room modal */
#add-room-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

#add-room-modal.active {
    display: flex;
}

.modal-content {
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.image-grid-item {
    aspect-ratio: 2/1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.image-grid-item:hover {
    border-color: rgba(253, 173, 1, 0.4);
}

.image-grid-item.selected {
    border-color: var(--primary-color);
}

.image-grid-item.used {
    opacity: 0.35;
    pointer-events: none;
}

.image-grid-item.used::after {
    content: 'In use';
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 3px;
}

.image-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Inline rename input */
.inline-rename {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(253, 173, 1, 0.4);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 13px;
    font-family: 'Lato', sans-serif;
    padding: 2px 6px;
    width: 120px;
    outline: none;
}

/* ============================================
   TOURS MANAGER STYLES
   ============================================ */

#tours-manager {
    min-height: calc(100vh - 77px);
    min-height: calc(100dvh - 77px);
    background: var(--dark-bg);
}

.tour-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tour-card:hover {
    background: rgba(253, 173, 1, 0.06);
    border-color: rgba(253, 173, 1, 0.25);
}

.tour-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(253, 173, 1, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 20px;
}

.tour-card-info {
    flex: 1;
    min-width: 0;
}

.tour-card-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tour-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.tour-card-meta span+span::before {
    content: '·';
    margin: 0 6px;
}

.tour-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tour-card-actions button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s ease;
}

.tour-card-actions button:hover {
    background: rgba(255, 80, 80, 0.15);
    border-color: rgba(255, 80, 80, 0.3);
    color: #ff5050;
}

.tours-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.tours-empty svg {
    display: block;
    margin: 0 auto 16px;
    opacity: 0.3;
}

/* Back to tours button in editor header */
.editor-back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.editor-back-btn:hover {
    color: var(--primary-color);
}

/* Editor body — also prevent scroll and hide footer */
body:has(#editor-wrapper) {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

body:has(#editor-wrapper) #footer,
body:has(#editor-wrapper) .footer {
    display: none !important;
}

/* Editor mobile layout */
@media (max-width: 768px) {
    #editor-wrapper {
        flex-direction: column;
        height: calc(100dvh - 59px);
    }

    #editor-panel {
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }

    #editor-viewer-container {
        height: 50%;
    }

    .editor-panel-header {
        padding: 12px 16px;
    }

    .editor-panel-header h2 {
        font-size: 1rem;
    }

    .editor-tab {
        padding: 10px 8px;
        font-size: 0.75rem;
    }

    .editor-tab-content {
        padding: 14px 16px;
    }

    .editor-actions {
        padding: 12px 16px;
    }

    #coord-display {
        bottom: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 10px;
    }

    #placement-indicator {
        top: 8px;
        font-size: 0.75rem;
        padding: 6px 14px;
    }

    /* Tours manager mobile */
    #tours-manager h1 {
        font-size: 1.4rem !important;
    }

    .tour-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .tour-card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .tour-card-name {
        font-size: 0.95rem;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}