.tour-viewer-shell {
    position: relative;

    width: 100%;
    min-height: 70vh;

    overflow: hidden;

    background: #111;

    border-radius: 1rem;

    direction: ltr;
}


.tour-viewer {
    position: relative;

    width: 100%;
    height: 70vh;
    min-height: 480px;

    overflow: hidden;

    direction: ltr;
}


.tour-viewer canvas {
    direction: ltr;
}


/*
 * خود Marzipano موقعیت Wrapper
 * هر Hotspot را کنترل می‌کند.
 *
 * بنابراین روی Hotspot اصلی:
 * position:absolute
 * left/top
 * transform
 *
 * قرار نمی‌دهیم.
 */
.tour-hotspot {
    border: 0;

    font-family: inherit;

    direction: rtl;
}


/*
 * Hotspot انتقال به Scene دیگر
 */
.tour-hotspot-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;

    min-height: 2rem;

    /*
     * نقطه Marzipano گوشه بالا-چپ
     * عنصر است. با Margin منفی،
     * مرکز آیکون را روی نقطه قرار
     * می‌دهیم، بدون دخالت در transform.
     */
    margin-top: -1rem;
    margin-left: -1rem;

    padding:
        0.4rem
        0.7rem;

    color: #fff;

    background:
        rgba(
            13,
            110,
            253,
            0.94
        );

    border: 2px solid #fff;

    border-radius: 999px;

    box-shadow:
        0
        0.35rem
        1rem
        rgba(
            0,
            0,
            0,
            0.3
        );

    cursor: pointer;

    white-space: nowrap;

    user-select: none;
}


.tour-hotspot-link:hover {
    background:
        rgba(
            13,
            110,
            253,
            1
        );
}


.tour-hotspot-link:focus-visible {
    outline:
        3px solid
        rgba(
            255,
            255,
            255,
            0.8
        );

    outline-offset: 2px;
}


.tour-hotspot-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 1.3rem;
    height: 1.3rem;

    font-size: 1rem;
    line-height: 1;

    direction: ltr;
}


.tour-hotspot-label {
    display: inline-block;

    font-size: 0.85rem;
    line-height: 1.4;

    direction: rtl;
}


/*
 * Hotspot اطلاعاتی
 */
.tour-hotspot-info {
    position: relative;

    width: 2rem;
    height: 2rem;

    margin-top: -1rem;
    margin-left: -1rem;

    direction: rtl;
}


.tour-hotspot-info-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 2rem;
    height: 2rem;

    padding: 0;

    color: #fff;

    background:
        rgba(
            25,
            135,
            84,
            0.96
        );

    border:
        2px solid #fff;

    border-radius: 50%;

    box-shadow:
        0
        0.35rem
        1rem
        rgba(
            0,
            0,
            0,
            0.3
        );

    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    direction: ltr;
}


.tour-hotspot-info-button:hover {
    background:
        rgba(
            25,
            135,
            84,
            1
        );
}


.tour-hotspot-info-panel {
    position: absolute;

    z-index: 50;

    right: 0;
    bottom: calc(100% + 0.6rem);

    width: 240px;

    padding: 0.8rem;

    color: #212529;
    background: #fff;

    border-radius: 0.75rem;

    box-shadow:
        0
        0.5rem
        1.5rem
        rgba(
            0,
            0,
            0,
            0.22
        );

    text-align: right;

    direction: rtl;
}


.tour-hotspot-info-panel[hidden] {
    display: none;
}


.tour-hotspot-info-panel strong {
    display: block;

    margin: 0;

    font-size: 0.9rem;
}


.tour-hotspot-info-panel p {
    margin:
        0.4rem
        0
        0;

    font-size: 0.85rem;
    line-height: 1.7;
}


/*
 * Toolbar روی Viewer
 */
.tour-viewer-toolbar {
    position: absolute;

    z-index: 100;

    top: 1rem;
    right: 1rem;
    left: 1rem;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    pointer-events: none;

    direction: rtl;
}


.tour-viewer-title {
    max-width: 60%;

    padding:
        0.55rem
        0.9rem;

    color: #fff;

    background:
        rgba(
            0,
            0,
            0,
            0.62
        );

    border-radius: 0.75rem;

    pointer-events: auto;

    direction: rtl;
}


.tour-viewer-actions {
    display: flex;

    gap: 0.5rem;

    pointer-events: auto;

    direction: rtl;
}


/*
 * فهرست Sceneها
 */
.tour-scene-list {
    display: flex;
    flex-wrap: wrap;

    gap: 0.5rem;

    direction: rtl;
}


.tour-scene-button.active {
    font-weight: 700;
}


/*
 * Fullscreen
 */
.tour-viewer:fullscreen {
    width: 100vw;
    height: 100vh;

    min-height: 100vh;

    background: #111;
}


.tour-viewer:fullscreen canvas {
    width: 100%;
    height: 100%;
}


/*
 * Mobile
 */
@media (
    max-width: 767.98px
) {
    .tour-viewer-shell {
        min-height: 60vh;

        border-radius: 0;
    }

    .tour-viewer {
        height: 60vh;
        min-height: 420px;
    }

    .tour-viewer-title {
        max-width: 70%;

        font-size: 0.9rem;
    }

    .tour-hotspot-label {
        display: none;
    }

    .tour-hotspot-link {
        width: 2.2rem;
        height: 2.2rem;

        min-height: 2.2rem;

        margin-top: -1.1rem;
        margin-left: -1.1rem;

        padding: 0;

        border-radius: 50%;
    }

    .tour-hotspot-icon {
        width: auto;
        height: auto;
    }

    .tour-hotspot-info-panel {
        width: 210px;
    }
}
/* Panorama download / decode progress */
.tour-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    direction: rtl;
    background: rgba(4, 8, 15, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.tour-loading-overlay[hidden] {
    display: none !important;
}

.tour-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.tour-loading-card {
    width: min(420px, calc(100vw - 2rem));
    padding: 1rem 1.05rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    color: #fff;
    background: rgba(10, 15, 24, 0.9);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.tour-loading-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 0.7rem;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #536fee, #7d94ff);
    box-shadow: 0 8px 24px rgba(83, 111, 238, 0.34);
}

.tour-loading-icon i {
    font-size: 1.15rem;
}

.tour-loading-copy strong,
.tour-loading-copy span {
    display: block;
}

.tour-loading-copy strong {
    font-size: 0.94rem;
    font-weight: 900;
}

.tour-loading-copy span {
    margin-top: 0.18rem;
    color: rgba(232, 238, 248, 0.72);
    font-size: 0.74rem;
    line-height: 1.7;
}

.tour-loading-progress {
    position: relative;
    height: 8px;
    margin-top: 0.9rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.tour-loading-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6f8cff, #9caeff);
    box-shadow: 0 0 14px rgba(111, 140, 255, 0.45);
    transition: width 0.12s linear;
}

.tour-loading-progress.is-indeterminate .tour-loading-progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38% !important;
    animation: tourLoaderIndeterminate 1.1s ease-in-out infinite;
}

.tour-loading-overlay.is-processing .tour-loading-progress-bar {
    animation: tourLoaderPulse 1s ease-in-out infinite alternate;
}

.tour-loading-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.55rem;
    font-size: 0.72rem;
}

.tour-loading-meta span {
    color: rgba(232, 238, 248, 0.68);
}

.tour-loading-meta strong {
    color: #fff;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.tour-loading-retry {
    width: 100%;
    margin-top: 0.85rem;
    border-radius: 11px;
    font-weight: 800;
}

.tour-loading-overlay.is-error .tour-loading-icon {
    background: linear-gradient(135deg, #dc3545, #ef6572);
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.28);
}

.tour-loading-overlay.is-error .tour-loading-progress-bar {
    width: 100% !important;
    background: #dc3545;
    animation: none;
}

@keyframes tourLoaderIndeterminate {
    0% { right: -42%; }
    50% { right: 31%; }
    100% { right: 104%; }
}

@keyframes tourLoaderPulse {
    from { opacity: 0.72; }
    to { opacity: 1; }
}

@media (max-width: 575.98px) {
    .tour-loading-overlay {
        padding: 0.8rem;
    }

    .tour-loading-card {
        width: min(360px, calc(100vw - 1.6rem));
        padding: 0.85rem 0.9rem;
        border-radius: 17px;
    }

    .tour-loading-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }
}
