/* ============================================================
   SureLife Care and Services — Interactive Virtual Branch Tour
   Cylindrical Panorama Viewer (Light & Dark Theme Studio Aware)
   ============================================================ */

.lp-tour {
    position: relative;
    background: var(--bg-dark-secondary, #062318);
    overflow: hidden;
}

.lp-tour .section-divider {
    margin: 0 auto 1.25rem;
}

/* ── Branch Selector Pill Bar ── */
.lp-tour-branches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}

.lp-tour-branch-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1.5px solid rgba(16, 185, 129, 0.32);
    background: rgba(6, 32, 22, 0.78);
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.lp-tour-branch-pill:hover {
    border-color: #10b981;
    color: #ffffff;
    transform: translateY(-1px);
}

.lp-tour-branch-pill.is-active {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 8px 22px -6px rgba(16, 185, 129, 0.48);
}

.lp-tour-branch-loc {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.82;
}

html[data-theme-mode="light"] .lp-tour-branch-pill {
    background: #ffffff;
    border-color: rgba(5, 150, 105, 0.28);
    color: #1e293b;
}

html[data-theme-mode="light"] .lp-tour-branch-pill:hover {
    background: #ecfdf5;
    color: #065f46;
}

html[data-theme-mode="light"] .lp-tour-branch-pill.is-active {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    border-color: #047857;
    color: #ffffff;
}

.lp-tour-shell {
    position: relative;
    border-radius: 1.25rem;
    border: 1.5px solid rgba(16, 185, 129, 0.28);
    background: rgba(6, 32, 22, 0.85);
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.48);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

html[data-theme-mode="light"] .lp-tour {
    background: linear-gradient(180deg, #f8fafc 0%, #ecfdf5 100%);
}

html[data-theme-mode="light"] .lp-tour-shell {
    background: #ffffff;
    border-color: rgba(5, 150, 105, 0.24);
    box-shadow: 0 24px 54px -20px rgba(6, 78, 59, 0.18);
}

/* ── Top HUD Bar ── */
.lp-tour-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(16, 185, 129, 0.18);
    background: rgba(6, 32, 22, 0.92);
}

html[data-theme-mode="light"] .lp-tour-topbar {
    background: #f0fdf4;
    border-bottom-color: rgba(5, 150, 105, 0.16);
}

.lp-tour-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.lp-tour-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.38);
    flex-shrink: 0;
}

html[data-theme-mode="light"] .lp-tour-step-pill {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.lp-tour-scene-heading {
    min-width: 0;
}

.lp-tour-scene-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.25;
}

.lp-tour-scene-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.35;
}

html[data-theme-mode="light"] .lp-tour-scene-title {
    color: #064e3b;
}

html[data-theme-mode="light"] .lp-tour-scene-desc {
    color: #475569;
}

/* ── Control Buttons ── */
.lp-tour-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.lp-tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2.15rem;
    padding: 0 0.72rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 41, 32, 0.85);
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.lp-tour-btn:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.55);
    color: #ffffff;
}

.lp-tour-btn:active {
    transform: scale(0.96);
}

.lp-tour-btn[aria-pressed="true"] {
    background: rgba(16, 185, 129, 0.28);
    border-color: #10b981;
    color: #a7f3d0;
}

html[data-theme-mode="light"] .lp-tour-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

html[data-theme-mode="light"] .lp-tour-btn:hover {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

html[data-theme-mode="light"] .lp-tour-btn[aria-pressed="true"] {
    background: #059669;
    border-color: #047857;
    color: #ffffff;
}

.lp-tour-btn-icon {
    width: 2.15rem;
    padding: 0;
}

/* ── Interactive Panorama Viewport ── */
.lp-tour-viewport {
    position: relative;
    width: 100%;
    height: clamp(320px, 52vh, 520px);
    background: #04140e;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    outline: none;
}

.lp-tour-viewport:focus-visible {
    box-shadow: inset 0 0 0 2px #10b981;
}

.lp-tour-viewport.is-dragging {
    cursor: grabbing;
}

.lp-tour-camera {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: scale(1);
    filter: blur(0px);
    opacity: 1;
    will-change: transform, filter, opacity;
    transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), filter 0.32s ease, opacity 0.28s ease;
}

.lp-tour-camera.is-travel-out {
    transform: scale(1.38);
    filter: blur(4px);
    opacity: 0.08;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.28s ease, opacity 0.26s ease;
}

.lp-tour-camera.is-travel-out-soft {
    transform: scale(1.1);
    filter: blur(2px);
    opacity: 0.14;
    transition: transform 0.22s ease-out, filter 0.22s ease, opacity 0.2s ease;
}

.lp-tour-camera.is-travel-in-prep {
    transform: scale(1.12);
    filter: blur(2px);
    opacity: 0.12;
    transition: none !important;
}

.lp-tour-stage {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    will-change: transform;
    transform-origin: 0 50%;
    opacity: 1;
    transition: opacity 0.28s ease;
}

.lp-tour-stage.is-switching {
    opacity: 0.15;
}

.lp-tour-tile {
    position: relative;
    height: 100%;
    flex: 0 0 auto;
}

.lp-tour-image {
    display: block;
    height: 100%;
    width: 100%;
    max-width: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* ── Loading Overlay ── */
.lp-tour-loader {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: rgba(4, 20, 14, 0.78);
    backdrop-filter: blur(4px);
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lp-tour-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lp-tour-spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 3px solid rgba(16, 185, 129, 0.25);
    border-top-color: #10b981;
    animation: lpTourSpin 0.8s linear infinite;
}

@keyframes lpTourSpin {
    to { transform: rotate(360deg); }
}

/* ── Walk-Through Hotspot Pins ── */
.lp-tour-hotspots {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.lp-tour-hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.85rem 0.42rem 0.5rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    background: rgba(6, 46, 32, 0.86);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    z-index: 6;
}

.lp-tour-hotspot:hover,
.lp-tour-hotspot:focus-visible {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(5, 150, 105, 0.96);
    border-color: #a7f3d0;
    outline: none;
}

.lp-tour-hotspot-dot {
    position: relative;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #10b981;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lp-tour-hotspot-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    border: 2px solid rgba(110, 231, 183, 0.75);
    animation: lpTourPulse 2s ease-out infinite;
}

@keyframes lpTourPulse {
    0% { transform: scale(0.88); opacity: 0.95; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ── Floating Viewport Helpers ── */
.lp-tour-drag-hint {
    position: absolute;
    top: 0.9rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.85rem;
    border-radius: 999px;
    background: rgba(4, 20, 14, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 600;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.lp-tour-drag-hint.is-faded {
    opacity: 0;
}

/* ── Horizontal Pan Minimap Track ── */
.lp-tour-pan-track {
    position: absolute;
    left: 50%;
    bottom: 0.85rem;
    transform: translateX(-50%);
    z-index: 10;
    width: min(220px, 52%);
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
    pointer-events: none;
}

.lp-tour-pan-thumb {
    height: 100%;
    width: 28%;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #10b981);
    transform: translateX(0);
    will-change: transform, width;
}

/* ── Scene Filmstrip Switcher ── */
.lp-tour-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0.9rem 1.25rem 1.1rem;
    background: rgba(6, 32, 22, 0.94);
    border-top: 1px solid rgba(16, 185, 129, 0.18);
}

html[data-theme-mode="light"] .lp-tour-strip {
    background: #f8fafc;
    border-top-color: rgba(5, 150, 105, 0.14);
}

.lp-tour-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid transparent;
    background: rgba(15, 41, 32, 0.7);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme-mode="light"] .lp-tour-thumb {
    background: #ffffff;
    border-color: #e2e8f0;
}

.lp-tour-thumb:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.55);
}

.lp-tour-thumb.is-active {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.28);
}

.lp-tour-thumb-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: #04140e;
}

.lp-tour-thumb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.lp-tour-thumb:hover .lp-tour-thumb-media img {
    transform: scale(1.06);
}

.lp-tour-thumb-num {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: rgba(4, 20, 14, 0.78);
    color: #6ee7b7;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.lp-tour-thumb.is-active .lp-tour-thumb-num {
    background: #059669;
    color: #ffffff;
}

.lp-tour-thumb-label {
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-theme-mode="light"] .lp-tour-thumb-label {
    color: #1e293b;
}

.lp-tour-thumb.is-active .lp-tour-thumb-label {
    color: #6ee7b7;
}

html[data-theme-mode="light"] .lp-tour-thumb.is-active .lp-tour-thumb-label {
    color: #065f46;
}

/* ── Fullscreen Mode (Native + iOS CSS Fallback) ── */
.lp-tour-shell:fullscreen,
.lp-tour-shell.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    background: #04140e;
}

.lp-tour-shell:fullscreen .lp-tour-viewport,
.lp-tour-shell.is-fullscreen .lp-tour-viewport {
    flex: 1 1 auto;
    height: auto;
}

/* ── Responsive Adjustments ── */
@media (max-width: 900px) {
    .lp-tour-strip {
        grid-template-columns: repeat(5, minmax(132px, 1fr));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0.75rem 0.9rem 0.9rem;
    }
}

@media (max-width: 640px) {
    .lp-tour-topbar {
        padding: 0.75rem 0.9rem;
    }

    .lp-tour-btn-label {
        display: none;
    }

    .lp-tour-viewport {
        height: 300px;
    }

    .lp-tour-nav-arrow {
        width: 2.15rem;
        height: 2.15rem;
    }

    .lp-tour-hotspot {
        font-size: 0.7rem;
        padding: 0.34rem 0.7rem 0.34rem 0.4rem;
    }
}
