/* ============================================================
   Dodeka Scene Switcher – Stylesheet v1.0.0
   Enthält: Wrapper, Layer, Transitions, UI-Panel,
            Button, Progress-Bar, Lightbox, Overlays
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.dss-wrapper {
    position: relative;
    /* Volle Breite – kritisch damit GSAP beim Pinnen nicht horizontal springt */
    width: 100%;
    max-width: 100%;
    /* Kein left/right/margin auto – GSAP braucht eine saubere Ausgangsbreite */
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    display: block;
    /* perspective für Flip-Transition */
    perspective: 1200px;
}

/* ── Scene Layers ────────────────────────────────────────── */
.dss-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Layers starten versteckt */
    opacity: 0;
    pointer-events: none;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
}
.dss-layer--active {
    opacity: 1;
    pointer-events: all;
    z-index: 1;
}

/* ── Canvas ──────────────────────────────────────────────── */
.dss-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
}
.dss-canvas:active { cursor: grabbing; }
.dss-canvas[data-has-links="true"] { cursor: pointer; }

/* ── Lightbox ────────────────────────────────────────────── */
.dss-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 99999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}
.dss-lightbox.dss-lb-visible {
    opacity: 1;
    pointer-events: all;
}
.dss-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.dss-lightbox-img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .7);
}
.dss-lightbox-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #000;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
    z-index: 10;
}
.dss-lightbox-video {
    display: block;
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .7);
    background: #000;
}
.dss-lightbox-caption {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .08);
    border-radius: 6px;
    text-align: center;
}
.dss-lb-caption-text {
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
    margin: 0 0 6px;
    line-height: 1.5;
}
.dss-lb-caption-text:last-child { margin-bottom: 0; }
.dss-lb-caption-link {
    display: inline-block;
    color: #aad4ff;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid rgba(170, 212, 255, .4);
    padding-bottom: 1px;
    transition: color .2s, border-color .2s;
}
.dss-lb-caption-link:hover {
    color: #c8e4ff;
    border-color: rgba(200, 228, 255, .7);
}

/* ── Scene-interne Button-Wrap (Scroll-Unpin) ─────────────── */
/* Diese werden vom Switcher versteckt – nur die globale UI zählt */
.dss-btn-wrap {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: opacity .4s;
}
.dss-btn-wrap.dss-btn-visible {
    opacity: 1;
    pointer-events: all;
}
.dss-unpin-btn {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .15s;
    display: inline-block;
    white-space: nowrap;
}
.dss-unpin-btn.dss-btn-shadow { box-shadow: 0 4px 20px rgba(0, 0, 0, .4); }
.dss-unpin-btn:hover { transform: translateY(-2px); }
.dss-key-hint {
    color: rgba(255, 255, 255, .5);
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    text-align: center;
}

/* ── Text-Overlay Tooltip ────────────────────────────────── */
.dss-overlay-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 6px;
    max-width: 200px;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    transition: opacity .2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .1);
}

/* ================================================================
   GLOBAL UI PANEL
   (über beiden Layern – enthält Switch-Button, Hint, Progress)
================================================================ */
.dss-ui-panel {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease;
}
.dss-ui-panel.dss-ui--visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Global Hint Text ────────────────────────────────────── */
.dss-global-hint {
    color: rgba(255, 255, 255, .5);
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
    letter-spacing: 0.03em;
}

/* ── Switch Button ───────────────────────────────────────── */
.dss-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease, background .15s ease, filter .2s ease;
    /* padding, radius, border, colors come from PHP inline style */
    position: relative;
    overflow: hidden;
}
/* Ripple effect auf Click */
.dss-switch-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background .3s ease;
    border-radius: inherit;
}
.dss-switch-btn:active::after {
    background: rgba(255, 255, 255, .15);
}
.dss-switch-btn:hover {
    transform: translateY(-2px);
}
.dss-switch-btn.dss-btn-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}
.dss-switch-btn.dss-btn-shadow:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
/* Transition State: Spin-Overlay während Wechsel */
.dss-switch-btn.dss-btn--switching {
    pointer-events: none;
    filter: brightness(0.85);
}
.dss-switch-btn .dss-btn-icon {
    display: inline-flex;
    align-items: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform .3s ease;
}
.dss-switch-btn .dss-btn-icon svg {
    width: 100%;
    height: 100%;
}
.dss-switch-btn:hover .dss-btn-icon {
    transform: translateX(3px);
}

/* ── Keyboard Shortcut Badge ─────────────────────────────── */
.dss-kbd-badge {
    font-size: 11px;
    font-weight: 700;
    opacity: .55;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: 0;
    line-height: 1.6;
    pointer-events: none;
}

/* ── Progress Bar (Auto-Switch) ──────────────────────────── */
.dss-progress-wrap {
    width: 100%;
    min-width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, .18);
    border-radius: 2px;
    overflow: hidden;
    display: none;     /* shown via JS when enabled */
    order: -1;         /* above button */
}
.dss-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,1) 100%);
    transition: width .1s linear;
}

/* ── View Label Badge ────────────────────────────────────── */
.dss-view-label {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, .85);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .4s ease, transform .4s ease;
}
.dss-view-label.dss-view-label--visible {
    opacity: 1;
    transform: translateY(0);
}
.dss-view-label .dss-view-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 767px) {
    .dss-global-hint { display: none; }
    .dss-kbd-badge   { display: none; }
    .dss-ui-panel    { bottom: 20px; gap: 8px; }
    .dss-view-label  { top: 10px; right: 12px; }
}

/* ================================================================
   X-RAY MODE BUTTON & STATE
================================================================ */
.dss-xray-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.dss-xray-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}
.dss-xray-btn--active {
    background: rgba(100, 220, 255, 0.22) !important;
    color: #7eefff !important;
    border-color: rgba(100, 220, 255, 0.5) !important;
    box-shadow: 0 0 12px rgba(100, 220, 255, 0.25) !important;
}

/* X-Ray layers: outside gets low opacity, inside shines through */
.dss-wrapper.dss-xray-active .dss-layer--outside {
    mix-blend-mode: screen;
}

/* Explosive + Wireframe: prevent flash during transition */
.dss-layer { backface-visibility: hidden; }
