/*
 * 4D Vision - Viewer platform chrome integration
 * Scope: loading/error states, info panels, platform buttons and toolbars only.
 * Never style panorama canvas, Pannellum UI, hotspots, POIs, tour modals,
 * custom_html or custom tour controls.
 * Loaded after the legacy viewer CSS and before custom.css/custom_<code>.css;
 * :where() keeps specificity low so tour custom CSS remains authoritative.
 */

:where(body.brand-4d) #background_loading {
    background-color: var(--4d-bg-deep, #070B14);
}

:where(body.brand-4d) .loading .protect {
    width: calc(100vw - 2rem);
    max-width: 430px;
    padding: clamp(1.15rem, 4vw, 1.75rem);
    color: var(--4d-text, #F5F8FC);
    text-align: center;
    background: rgba(18, 26, 39, 0.94);
    border: 1px solid var(--4d-border-glow, rgba(21, 223, 239, 0.18));
    border-radius: var(--4d-radius-lg, 18px);
    box-shadow: var(--4d-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.42));
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

:where(body.brand-4d) .protect_title {
    color: var(--4d-text, #F5F8FC);
}

:where(body.brand-4d) .protect_description {
    color: var(--4d-text-muted, #AAB4C3);
}

:where(body.brand-4d) .password-wrapper {
    width: min(320px, calc(100vw - 4rem));
    overflow: hidden;
    background: var(--4d-surface, #121A27);
    border: 1px solid var(--4d-border, #263247);
    border-radius: var(--4d-radius, 12px);
    box-shadow: var(--4d-shadow-sm, 0 6px 18px rgba(0, 0, 0, 0.22));
}

:where(body.brand-4d) .password-wrapper input {
    width: calc(100% - 80px);
    height: 2.75rem;
    padding: 0.55rem 0.8rem;
    color: var(--4d-text, #F5F8FC);
    background: transparent;
    border: 0;
    border-radius: 0;
    text-indent: 0;
}

:where(body.brand-4d) .password-wrapper input::placeholder {
    color: var(--4d-text-subtle, #70747B);
}

:where(body.brand-4d) .password-wrapper input:focus {
    background: transparent;
    box-shadow: inset 0 0 0 2px rgba(21, 223, 239, 0.5);
}

:where(body.brand-4d) #vt_password.error_input,
:where(body.brand-4d) .error_input {
    box-shadow: 0 0 0 3px rgba(255, 91, 110, 0.24);
}

:where(body.brand-4d) .password-wrapper button {
    width: 80px;
    height: 2.75rem;
    color: #FFFFFF;
    background-color: var(--4d-blue-electric, #066BFB);
    background-image: var(--4d-gradient-primary-button, linear-gradient(135deg, #066BFB, #15DFEF));
    border: 0;
    border-radius: 0;
    font: inherit;
    text-shadow: none;
}

:where(body.brand-4d) .password-wrapper button:hover,
:where(body.brand-4d) .password-wrapper button:focus {
    color: #FFFFFF;
    background-color: var(--4d-blue-primary, #0579F8);
    box-shadow: inset 0 0 0 2px rgba(21, 223, 239, 0.62);
    outline: 0;
}

:where(body.brand-4d) #icon_play {
    color: #FFFFFF;
    background: var(--4d-gradient-primary, linear-gradient(135deg, #066BFB, #15DFEF, #6E35E8));
    border: 1px solid rgba(21, 223, 239, 0.5);
    border-radius: 50%;
    box-shadow: 0 18px 48px rgba(6, 107, 251, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    text-shadow: 0 1px 12px rgba(7, 11, 20, 0.4);
    transition: transform var(--4d-duration, 220ms) var(--4d-ease, ease), box-shadow var(--4d-duration, 220ms) var(--4d-ease, ease);
}

:where(body.brand-4d) #icon_play:hover,
:where(body.brand-4d) #icon_play:focus-visible {
    box-shadow: var(--4d-focus-ring, 0 0 0 3px rgba(21, 223, 239, 0.34)), 0 20px 54px rgba(6, 107, 251, 0.42);
    outline: 0;
    transform: translate(-50%, -50%) scale(1.04);
}

:where(body.brand-4d) .progress-circle,
:where(body.brand-4d) #loading_pano,
:where(body.brand-4d) .loading_vr {
    color: var(--4d-cyan, #15DFEF);
}

:where(body.brand-4d) .loading_vr {
    background: rgba(7, 11, 20, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

:where(body.brand-4d) #loading_pano {
    filter: drop-shadow(0 0 10px rgba(21, 223, 239, 0.4));
}

:where(body.brand-4d) #loading_pano svg path {
    stroke: var(--4d-cyan, #15DFEF);
}

:where(body.brand-4d) #loading_pano svg circle {
    fill: var(--4d-cyan, #15DFEF);
}

:where(body.brand-4d) .info_box_content {
    width: min(760px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: clamp(1.15rem, 3vw, 2rem);
    overflow: auto;
    color: var(--4d-text, #F5F8FC);
    text-align: left;
    background: rgba(18, 26, 39, 0.98);
    border: 1px solid var(--4d-border-glow, rgba(21, 223, 239, 0.18));
    border-radius: var(--4d-radius-lg, 18px);
    box-shadow: var(--4d-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.42));
    scrollbar-color: #40516A var(--4d-bg-deep, #070B14);
    scrollbar-width: thin;
}

:where(body.brand-4d) .info_box_content h1,
:where(body.brand-4d) .info_box_content h2,
:where(body.brand-4d) .info_box_content h3,
:where(body.brand-4d) .info_box_content h4,
:where(body.brand-4d) .info_box_content h5,
:where(body.brand-4d) .info_box_content h6 {
    color: var(--4d-text, #F5F8FC);
}

:where(body.brand-4d) .info_box_content a {
    color: var(--4d-cyan, #15DFEF);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

:where(body.brand-4d) .info_box_content a:hover,
:where(body.brand-4d) .info_box_content a:focus {
    color: #FFFFFF;
}

:where(body.brand-4d) .info_box_content hr {
    border-color: var(--4d-border, #263247);
}

:where(body.brand-4d) .info_box_content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--4d-radius, 12px);
}

:where(body.brand-4d) .info_box_content blockquote {
    padding-left: 1rem;
    color: var(--4d-text-muted, #AAB4C3);
    border-left: 2px solid var(--4d-cyan, #15DFEF);
}

:where(body.brand-4d) .controls_btn:focus-visible,
:where(body.brand-4d) .p_control:focus-visible,
:where(body.brand-4d) .fullscreen_control:focus-visible,
:where(body.brand-4d) .song_control:focus-visible,
:where(body.brand-4d) .map_control:focus-visible,
:where(body.brand-4d) .map_tour_control:focus-visible,
:where(body.brand-4d) .menu_controls .title i:focus-visible,
:where(body.brand-4d) .list_alt_menu .title i:focus-visible,
:where(body.brand-4d) .arrows_nav i:focus-visible,
:where(body.brand-4d) .list_slider #list_left:focus-visible,
:where(body.brand-4d) .list_slider #list_right:focus-visible {
    outline: 2px solid var(--4d-cyan, #15DFEF);
    outline-offset: 2px;
}

:where(body.brand-4d) .fullscreen_control,
:where(body.brand-4d) .song_control,
:where(body.brand-4d) .map_control,
:where(body.brand-4d) .map_tour_control,
:where(body.brand-4d) .menu_controls .title i,
:where(body.brand-4d) .list_alt_menu .title i {
    color: var(--4d-text, #F5F8FC);
    text-shadow: 0 1px 8px rgba(7, 11, 20, 0.55);
}

:where(body.brand-4d) .fullscreen_control:hover,
:where(body.brand-4d) .song_control:hover,
:where(body.brand-4d) .map_control:hover,
:where(body.brand-4d) .map_tour_control:hover,
:where(body.brand-4d) .menu_controls .title i:hover,
:where(body.brand-4d) .list_alt_menu .title i:hover {
    color: var(--4d-cyan, #15DFEF);
}

:where(body.brand-4d) .svt-player-privacy {
    position: fixed;
    bottom: 4.5rem;
    bottom: max(4.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.5rem));
    left: 50%;
    z-index: 60;
    width: auto;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    max-width: min(34rem, calc(100vw - 1.5rem));
    color: var(--4d-text, #F5F8FC);
    font-size: 0.78rem;
    line-height: 1.45;
    transform: translateX(-50%);
}

:where(body.brand-4d) .svt-player-privacy[hidden] {
    display: none;
}

:where(body.brand-4d) .svt-player-privacy details {
    width: 100%;
    max-height: calc(100vh - 6rem);
    max-height: min(22rem, calc(100vh - 6rem));
    overflow: auto;
    background: rgba(18, 26, 39, 0.94);
    border: 1px solid var(--4d-border, #263247);
    border-radius: var(--4d-radius, 12px);
    box-shadow: var(--4d-shadow, 0 14px 34px rgba(0, 0, 0, 0.3));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

:where(body.brand-4d) .svt-player-privacy summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.55rem;
    align-items: baseline;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    list-style: none;
}

:where(body.brand-4d) .svt-player-privacy summary::-webkit-details-marker {
    display: none;
}

:where(body.brand-4d) .svt-player-privacy summary:focus-visible {
    outline: 2px solid var(--4d-cyan, #15DFEF);
    outline-offset: 2px;
}

:where(body.brand-4d) .svt-player-privacy__summary {
    color: var(--4d-text, #F5F8FC);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(21, 223, 239, 0.58);
    text-underline-offset: 0.18em;
}

:where(body.brand-4d) .svt-player-privacy__hint {
    color: var(--4d-text-muted, #AAB4C3);
    font-size: 0.72rem;
}

:where(body.brand-4d) .svt-player-privacy__body {
    padding: 0.25rem 0.75rem 0.7rem;
    border-top: 1px solid var(--4d-border, #263247);
}

:where(body.brand-4d) .svt-player-privacy__body p {
    margin: 0.55rem 0 0;
    color: var(--4d-text-muted, #AAB4C3);
}

:where(body.brand-4d) .svt-player-privacy__body a {
    color: var(--4d-cyan, #15DFEF);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

:where(body.brand-4d) .svt-player-privacy__body a:hover,
:where(body.brand-4d) .svt-player-privacy__body a:focus {
    color: #FFFFFF;
}

:where(body.brand-4d) .svt-player-privacy__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
}

@media (max-width: 767.98px) {
    :where(body.brand-4d) .info_box_content {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }

    :where(body.brand-4d) .svt-player-privacy {
        bottom: 4.25rem;
        bottom: max(4.25rem, calc(env(safe-area-inset-bottom, 0px) + 4.25rem));
    }
}

@media (max-width: 420px) {
    :where(body.brand-4d) .password-wrapper {
        width: 100%;
    }

    :where(body.brand-4d) .password-wrapper input {
        width: calc(100% - 64px);
    }

    :where(body.brand-4d) .password-wrapper button {
        width: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(body.brand-4d) #icon_play {
        transition: none;
    }
}

@media (forced-colors: active) {
    :where(body.brand-4d) .loading .protect,
    :where(body.brand-4d) .info_box_content,
    :where(body.brand-4d) .password-wrapper {
        border: 1px solid CanvasText;
    }
}
