/**
 * Space Transformer – Stylesheet
 * Alle visuellen Stile für das 3D-Architektur-Widget
 */

/* ============================================================
   CSS-Variablen (Design-System)
   ============================================================ */
.st-wrapper {
    --st-farbe-primaer:     #c8a882;
    --st-farbe-dunkel:      #1a1a2e;
    --st-farbe-ui-bg:       rgba(10, 15, 30, 0.75);
    --st-farbe-ui-border:   rgba(200, 168, 130, 0.3);
    --st-farbe-ui-text:     #e8d5b0;
    --st-farbe-aktiv:       #c8a882;
    --st-radius:            8px;
    --st-uebergang:         all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --st-blur:              blur(12px);
    --st-font:              'Georgia', serif;
}

/* ============================================================
   Container & Canvas
   ============================================================ */
.st-wrapper {
    position:   relative;
    width:      100%;
    font-family: var(--st-font);
    line-height: 1.4;
}

.st-container {
    position:   relative;
    width:      100%;
    height:     600px;
    overflow:   hidden;
    background: #0a0f1e;
    border-radius: 12px;
    cursor:     grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.st-container:active {
    cursor: grabbing;
}

.st-canvas {
    position:   absolute;
    top:        0;
    left:       0;
    width:      100% !important;
    height:     100% !important;
    display:    block;
}

/* ============================================================
   Lade-Overlay
   ============================================================ */
.st-loader {
    position:   absolute;
    inset:      0;
    display:    flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0f1e;
    z-index:    100;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.st-loader-spinner {
    width:  48px;
    height: 48px;
    border: 3px solid rgba(200, 168, 130, 0.2);
    border-top-color: #c8a882;
    border-radius: 50%;
    animation: st-drehen 1s linear infinite;
    margin-bottom: 16px;
}

.st-loader-text {
    color:      var(--st-farbe-ui-text);
    font-size:  14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity:    0.7;
}

@keyframes st-drehen {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Form-Navigation (unten)
   ============================================================ */
.st-form-nav {
    position:   absolute;
    bottom:     60px;
    left:       50%;
    transform:  translateX(-50%);
    display:    flex;
    gap:        8px;
    z-index:    10;
    background: var(--st-farbe-ui-bg);
    border:     1px solid var(--st-farbe-ui-border);
    backdrop-filter: var(--st-blur);
    -webkit-backdrop-filter: var(--st-blur);
    border-radius: 40px;
    padding:    6px 10px;
}

.st-form-nav button {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            2px;
    background:     transparent;
    border:         1px solid transparent;
    border-radius:  24px;
    padding:        8px 14px;
    cursor:         pointer;
    color:          var(--st-farbe-ui-text);
    font-family:    var(--st-font);
    font-size:      11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition:     var(--st-uebergang);
    white-space:    nowrap;
}

.st-form-nav button:hover {
    background: rgba(200, 168, 130, 0.15);
    border-color: var(--st-farbe-ui-border);
}

.st-form-nav button.aktiv {
    background:   rgba(200, 168, 130, 0.25);
    border-color: var(--st-farbe-aktiv);
    color:        var(--st-farbe-aktiv);
}

.st-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.st-btn-label {
    font-size: 10px;
    opacity: 0.8;
}

/* ============================================================
   Tageszeit-Slider (unten)
   ============================================================ */
.st-tageszeit-panel {
    position:   absolute;
    bottom:     16px;
    left:       50%;
    transform:  translateX(-50%);
    display:    flex;
    align-items: center;
    gap:        10px;
    background: var(--st-farbe-ui-bg);
    border:     1px solid var(--st-farbe-ui-border);
    backdrop-filter: var(--st-blur);
    -webkit-backdrop-filter: var(--st-blur);
    border-radius: 24px;
    padding:    8px 16px;
    z-index:    10;
    min-width:  240px;
}

.st-tageszeit-label {
    display:    flex;
    align-items: center;
    gap:        6px;
    color:      var(--st-farbe-ui-text);
    font-size:  12px;
    white-space: nowrap;
}

.st-tageszeit-icon {
    font-size: 16px;
}

.st-tageszeit-slider {
    -webkit-appearance: none;
    appearance: none;
    flex:       1;
    height:     4px;
    background: linear-gradient(to right, #1a1a2e 0%, #ffd700 50%, #1a1a2e 100%);
    border-radius: 2px;
    outline:    none;
    cursor:     pointer;
    min-width:  100px;
}

.st-tageszeit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width:          16px;
    height:         16px;
    border-radius:  50%;
    background:     var(--st-farbe-aktiv);
    border:         2px solid #fff;
    cursor:         pointer;
    box-shadow:     0 0 6px rgba(200, 168, 130, 0.6);
    transition:     box-shadow 0.2s;
}

.st-tageszeit-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 12px rgba(200, 168, 130, 0.9);
}

.st-tageszeit-slider::-moz-range-thumb {
    width:          14px;
    height:         14px;
    border-radius:  50%;
    background:     var(--st-farbe-aktiv);
    border:         2px solid #fff;
    cursor:         pointer;
}

.st-tageszeit-wert {
    color:      var(--st-farbe-aktiv);
    font-size:  12px;
    min-width:  36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Info-Panel (links oben, erscheint bei Hover)
   ============================================================ */
.st-info-panel {
    position:   absolute;
    top:        16px;
    left:       16px;
    background: var(--st-farbe-ui-bg);
    border:     1px solid var(--st-farbe-ui-border);
    backdrop-filter: var(--st-blur);
    -webkit-backdrop-filter: var(--st-blur);
    border-radius: var(--st-radius);
    padding:    12px 16px;
    z-index:    10;
    max-width:  220px;
    opacity:    0;
    transform:  translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.st-info-panel.sichtbar {
    opacity:   1;
    transform: translateY(0);
}

.st-info-titel {
    color:       var(--st-farbe-aktiv);
    font-size:   14px;
    font-weight: bold;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.st-info-beschreibung {
    color:     var(--st-farbe-ui-text);
    font-size: 12px;
    opacity:   0.8;
}

/* ============================================================
   Aktions-Buttons (rechts)
   ============================================================ */
.st-aktionen {
    position:   absolute;
    top:        16px;
    right:      16px;
    display:    flex;
    flex-direction: column;
    gap:        8px;
    z-index:    10;
}

.st-btn-aktion {
    width:           40px;
    height:          40px;
    border-radius:   50%;
    background:      var(--st-farbe-ui-bg);
    border:          1px solid var(--st-farbe-ui-border);
    backdrop-filter: var(--st-blur);
    -webkit-backdrop-filter: var(--st-blur);
    color:           var(--st-farbe-ui-text);
    font-size:       18px;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      var(--st-uebergang);
    line-height:     1;
}

.st-btn-aktion:hover {
    background:   rgba(200, 168, 130, 0.25);
    border-color: var(--st-farbe-aktiv);
    color:        var(--st-farbe-aktiv);
    transform:    scale(1.08);
}

.st-btn-aktion.aktiv {
    background:   rgba(200, 168, 130, 0.35);
    border-color: var(--st-farbe-aktiv);
    color:        var(--st-farbe-aktiv);
}

/* ============================================================
   Hinweistext (unten links)
   ============================================================ */
.st-hinweis {
    position:   absolute;
    bottom:     16px;
    left:       16px;
    color:      rgba(232, 213, 176, 0.5);
    font-size:  11px;
    pointer-events: none;
    z-index:    5;
    letter-spacing: 0.05em;
    white-space: nowrap;
    /* auf kleinen Bildschirmen ausblenden */
}

/* ============================================================
   Lightbox
   ============================================================ */
.st-lightbox {
    position:   fixed;
    inset:      0;
    background: rgba(0, 0, 0, 0.88);
    z-index:    99999;
    display:    flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation:  st-einblenden 0.25s ease;
}

.st-lightbox[hidden] {
    display: none;
}

.st-lightbox-inhalt {
    position:   relative;
    max-width:  90vw;
    max-height: 90vh;
    background: #111827;
    border:     1px solid rgba(200, 168, 130, 0.4);
    border-radius: 12px;
    overflow:   hidden;
    display:    flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
}

.st-lightbox-bild {
    max-width:  100%;
    max-height: 70vh;
    object-fit: contain;
    display:    block;
}

.st-lightbox-titel {
    padding:     12px 20px 4px;
    color:       var(--st-farbe-aktiv);
    font-size:   18px;
    font-weight: bold;
}

.st-lightbox-beschreibung {
    padding:    0 20px 16px;
    color:      rgba(232, 213, 176, 0.8);
    font-size:  14px;
    max-width:  600px;
}

.st-lightbox-schliessen {
    position:   absolute;
    top:        12px;
    right:      12px;
    width:      36px;
    height:     36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border:     1px solid rgba(255, 255, 255, 0.2);
    color:      #fff;
    font-size:  16px;
    cursor:     pointer;
    display:    flex;
    align-items: center;
    justify-content: center;
    transition: var(--st-uebergang);
    z-index:    1;
}

.st-lightbox-schliessen:hover {
    background: rgba(200, 168, 130, 0.3);
    border-color: var(--st-farbe-aktiv);
}

@keyframes st-einblenden {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   Elementor-Editor-Vorschau
   ============================================================ */
.st-editor-vorschau {
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      linear-gradient(135deg, #0a0f1e 0%, #1a1a2e 100%) !important;
    min-height:      300px;
}

.st-editor-placeholder {
    text-align: center;
    padding:    40px;
}

.st-editor-icon {
    font-size:     64px;
    margin-bottom: 16px;
    opacity:       0.8;
}

.st-editor-text {
    color:         #c8a882;
    font-size:     24px;
    font-weight:   bold;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.st-editor-subtext {
    color:          rgba(200, 168, 130, 0.6);
    font-size:      14px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* ============================================================
   Vollbild-Modus
   ============================================================ */
.st-container:fullscreen {
    border-radius: 0;
    height:        100vh !important;
}

.st-container:-webkit-full-screen {
    border-radius: 0;
    height:        100vh !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
    .st-form-nav {
        bottom:  52px;
        padding: 4px 6px;
        gap:     4px;
    }

    .st-form-nav button {
        padding:  6px 8px;
        font-size: 9px;
    }

    .st-btn-icon {
        font-size: 14px;
    }

    .st-tageszeit-panel {
        min-width:  unset;
        width:      calc(100% - 32px);
        left:       16px;
        transform:  none;
        bottom:     12px;
        font-size:  11px;
    }

    .st-hinweis {
        display: none;
    }

    .st-aktionen {
        top:   12px;
        right: 12px;
    }

    .st-btn-aktion {
        width:  34px;
        height: 34px;
        font-size: 15px;
    }

    .st-info-panel {
        max-width: 160px;
        font-size: 11px;
    }
}

@media (max-width: 400px) {
    .st-form-nav {
        flex-wrap: wrap;
        border-radius: 12px;
        max-width: calc(100% - 16px);
    }

    .st-btn-label {
        display: none;
    }
}
