/* Depth3D Frontend Viewer */

.depth3d-wrapper {
    width: 100%;
    margin: 0 auto;
}

.depth3d-viewer {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: grab;
    background: #111;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}
.depth3d-viewer:active {
    cursor: grabbing;
}

.depth3d-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ─── Gyro Button ─── */
.depth3d-gyro-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
    display: none; /* shown via JS on touch devices */
    align-items: center;
    gap: 5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.25s;
}
.depth3d-gyro-btn:hover,
.depth3d-gyro-btn:focus {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}
.depth3d-gyro-btn.active {
    background: rgba(80, 180, 255, 0.2);
    border-color: rgba(80, 180, 255, 0.4);
    color: #80c8ff;
}
.depth3d-gyro-btn svg {
    flex-shrink: 0;
}

/* Show gyro button on touch-capable devices */
@media (hover: none) and (pointer: coarse) {
    .depth3d-gyro-btn {
        display: flex;
    }
}

/* ─── Loader ─── */
.depth3d-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    z-index: 4;
    transition: opacity 0.4s;
}
.depth3d-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.depth3d-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: d3d-spin 0.8s linear infinite;
}

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

/* ═══ INTERACTION HINT (Frontend) ═══ */
.depth3d-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.depth3d-hint.dismissed {
    opacity: 0;
}

.depth3d-hint-icon {
    width: 56px;
    height: 56px;
    color: rgba(255,255,255,0.7);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
    animation: d3d-hint-pulse 2.5s ease-in-out infinite;
}

.depth3d-hint-arrows {
    animation: d3d-hint-nudge 2.5s ease-in-out infinite;
}

.depth3d-hint-cube {
    animation: d3d-hint-rock 3s ease-in-out infinite;
    transform-origin: 32px 32px;
}

.depth3d-hint-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    letter-spacing: 0.03em;
}

@keyframes d3d-hint-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.06); opacity: 1; }
}

@keyframes d3d-hint-nudge {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(3px, 0); }
    75% { transform: translate(-3px, 0); }
}

@keyframes d3d-hint-rock {
    0%, 100% { transform: translate(22px, 22px) rotate(0deg); }
    33% { transform: translate(22px, 22px) rotate(6deg); }
    66% { transform: translate(22px, 22px) rotate(-6deg); }
}
