/* 360° panorama viewer iDevice (export CSS) */

.three-sixty-viewer-idevice {
    width: 100%;
    display: block;
}

.three-sixty-viewer-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 320px;
    aspect-ratio: 16 / 9;
    background-color: #111;
    border-radius: 6px;
    overflow: hidden;
    outline: none;
}

.three-sixty-viewer-wrapper:fullscreen,
.three-sixty-viewer-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    max-width: none;
}

.three-sixty-viewer-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.three-sixty-viewer-wrapper canvas:active {
    cursor: grabbing;
}

/* Flat (non-360) scene image, shown undistorted with letterboxing. */
.three-sixty-viewer-flat-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #111;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.three-sixty-viewer-wrapper:focus-within,
.three-sixty-viewer-wrapper canvas:focus {
    box-shadow: 0 0 0 3px rgba(64, 160, 220, 0.6);
}

.three-sixty-viewer-fallback {
    padding: 1em;
    background-color: #f3f3f3;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-style: italic;
    text-align: center;
}

.three-sixty-viewer-fullscreen-button {
    position: absolute;
    right: 8px;
    top: 8px;
    padding: 0.35em 0.7em;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    z-index: 2;
}

.three-sixty-viewer-fullscreen-button:hover,
.three-sixty-viewer-fullscreen-button:focus {
    background: rgba(0, 0, 0, 0.8);
    outline: none;
}

/* Pan navigation arrows */

.three-sixty-viewer-nav {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    grid-template-columns: repeat(3, 2em);
    grid-template-rows: 2em 2em;
    gap: 0.2em;
    z-index: 2;
}

.three-sixty-viewer-nav-btn {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.three-sixty-viewer-nav-btn:hover,
.three-sixty-viewer-nav-btn:focus {
    background: rgba(0, 0, 0, 0.85);
    outline: none;
}

.three-sixty-viewer-nav-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 1px;
}

.three-sixty-viewer-nav-left {
    grid-column: 1;
    grid-row: 2;
}
.three-sixty-viewer-nav-up {
    grid-column: 2;
    grid-row: 1;
}
.three-sixty-viewer-nav-down {
    grid-column: 2;
    grid-row: 2;
}
.three-sixty-viewer-nav-right {
    grid-column: 3;
    grid-row: 2;
}

.three-sixty-viewer-idevice [type="application/json"] {
    display: none !important;
}

/* Hotspot overlay */

.three-sixty-viewer-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.three-sixty-viewer-hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    z-index: 4;
}

.three-sixty-viewer-hotspot-icon {
    display: inline-block;
    width: 2.4em;
    height: 2.4em;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition:
        transform 0.15s ease,
        background 0.15s ease;
    position: relative;
}

.three-sixty-viewer-hotspot-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.7em;
    height: 0.7em;
    background: #fff;
    border-radius: 50%;
}

.three-sixty-viewer-hotspot.three-sixty-viewer-hotspot-goToScene .three-sixty-viewer-hotspot-icon::after {
    width: 0.8em;
    height: 0.8em;
    background: transparent;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    border-radius: 0;
    transform: rotate(-45deg);
    margin-left: -0.15em;
}

.three-sixty-viewer-hotspot:hover .three-sixty-viewer-hotspot-icon,
.three-sixty-viewer-hotspot:focus .three-sixty-viewer-hotspot-icon {
    transform: scale(1.1);
    background: rgba(64, 160, 220, 0.85);
    outline: none;
}

.three-sixty-viewer-hotspot:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
    border-radius: 50%;
}

.three-sixty-viewer-hotspot-label {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-size: 0.85rem;
    white-space: nowrap;
    pointer-events: none;
    max-width: 14em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.three-sixty-viewer-hotspot-label-left {
    order: -1;
}

.three-sixty-viewer-hotspot-label-top,
.three-sixty-viewer-hotspot-label-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.three-sixty-viewer-hotspot-label-top {
    bottom: 100%;
    margin-bottom: 0.4em;
}
.three-sixty-viewer-hotspot-label-bottom {
    top: 100%;
    margin-top: 0.4em;
}

/* Hotspot content modal */

.three-sixty-viewer-modal {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
    padding: 1em;
}

.three-sixty-viewer-modal-inner {
    background: #fff;
    color: #222;
    border-radius: 6px;
    max-width: min(640px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.three-sixty-viewer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6em 1em;
    border-bottom: 1px solid #e2e2e2;
}

.three-sixty-viewer-modal-title {
    margin: 0;
    font-size: 1.05rem;
}

.three-sixty-viewer-modal-close {
    background: transparent;
    border: 0;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2em 0.4em;
}

.three-sixty-viewer-modal-close:focus-visible {
    outline: 2px solid #4ea0d4;
    outline-offset: 2px;
}

.three-sixty-viewer-modal-body {
    padding: 1em;
    overflow: auto;
}

.three-sixty-viewer-modal-caption {
    margin-top: 0.5em;
    font-size: 0.9rem;
    color: #555;
}
