/**
 * Elementor WebGL Scene Master – Frontend-Styles
 */

/* ── Widget-Container ────────────────────────────────────────────────────── */

.ewsm-widget {
    position: relative;
    width:    100%;
    overflow: hidden;
    display:  block;
    /* Verhindert Flackern auf iOS */
    -webkit-transform: translateZ(0);
    transform:         translateZ(0);
}

.ewsm-widget.ewsm-fullscreen {
    height: 100% !important;
    min-height: 300px;
}

/* ── Canvas ──────────────────────────────────────────────────────────────── */

.ewsm-canvas {
    display: block;
    width:   100%  !important;
    height:  100%  !important;
    cursor:  crosshair;
    touch-action: none; /* Verhindert Standard-Scroll bei Touch-Interaktion */
}

/* ── Lade-Indikator ──────────────────────────────────────────────────────── */

.ewsm-loader {
    position:  absolute;
    inset:     0;
    display:   flex;
    align-items:     center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
    pointer-events: none;
}

.ewsm-loader-spinner {
    width:  48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ewsm-spin 0.8s linear infinite;
}

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

/* ── Overlay-Meldung (Fehler o.Ä.) ───────────────────────────────────────── */

.ewsm-overlay-message {
    position:   absolute;
    inset:      0;
    display:    flex;
    align-items:     center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color:      #ffffff;
    font-size:  14px;
    font-family: sans-serif;
    text-align: center;
    padding:    16px;
    z-index:    20;
}

/* ── Platzhalter (kein Bild ausgewählt) ──────────────────────────────────── */

.ewsm-placeholder {
    position:   absolute;
    inset:      0;
    display:    flex;
    align-items:     center;
    justify-content: center;
    background: #1a1a2e;
    color:      rgba(255, 255, 255, 0.5);
    font-size:  14px;
    font-family: sans-serif;
}

/* ── Steuer-Elemente (Reset-Button) ──────────────────────────────────────── */

.ewsm-controls {
    position:  absolute;
    bottom:    12px;
    right:     12px;
    z-index:   30;
}

.ewsm-reset-btn {
    display:    inline-flex;
    align-items: center;
    gap:        6px;
    background: rgba(0, 0, 0, 0.65);
    border:     1px solid rgba(255, 255, 255, 0.25);
    color:      #ffffff;
    font-size:  12px;
    font-family: sans-serif;
    padding:    6px 12px;
    border-radius: 4px;
    cursor:     pointer;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ewsm-reset-btn:hover {
    background: rgba(220, 50, 50, 0.75);
    border-color: rgba(255, 100, 100, 0.5);
}

.ewsm-reset-btn .dashicons {
    font-size:   14px;
    width:       14px;
    height:      14px;
    line-height: 14px;
}

/* ── Editor-Vorschau ─────────────────────────────────────────────────────── */

.ewsm-editor-preview {
    width:             100%;
    height:            100%;
    min-height:        200px;
    background-size:   cover;
    background-position: center;
    display:           flex;
    align-items:       flex-start;
    justify-content:   flex-end;
    padding:           12px;
    box-sizing:        border-box;
    position:          relative;
}

.ewsm-editor-badge {
    display:      inline-flex;
    align-items:  center;
    gap:          6px;
    background:   rgba(87, 61, 255, 0.85);
    color:        #ffffff;
    font-size:    12px;
    font-family:  sans-serif;
    padding:      5px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ewsm-editor-badge .dashicons {
    font-size:   14px;
    width:       14px;
    height:      14px;
    line-height: 14px;
}

/* ── Responsive Anpassungen ──────────────────────────────────────────────── */

@media ( max-width: 768px ) {
    .ewsm-reset-btn {
        font-size: 11px;
        padding:   5px 10px;
    }

    .ewsm-loader-spinner {
        width:  36px;
        height: 36px;
    }
}

/* ── Timeline-Controls ───────────────────────────────────────────────────── */

.ewsm-timeline-controls {
    position:   absolute;
    bottom:     12px;
    left:       50%;
    transform:  translateX(-50%);
    display:    flex;
    align-items: center;
    gap:        10px;
    background: rgba(0, 0, 0, 0.65);
    border:     1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding:    6px 14px;
    z-index:    30;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ewsm-tl-play-pause,
.ewsm-tl-restart {
    background: none;
    border:     none;
    color:      #fff;
    font-size:  16px;
    cursor:     pointer;
    padding:    0 4px;
    line-height: 1;
    transition: opacity .2s;
    opacity:    .8;
}

.ewsm-tl-play-pause:hover,
.ewsm-tl-restart:hover {
    opacity: 1;
}

.ewsm-tl-scrubber-wrap {
    width: 160px;
}

.ewsm-tl-scrubber {
    -webkit-appearance: none;
    width:  100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    outline: none;
}

.ewsm-tl-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width:  14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,.4);
}

.ewsm-tl-scrubber::-moz-range-thumb {
    width:  14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

/* ── Persistente Controls (Reset) – überarbeitetes Layout ────────────────── */

.ewsm-controls--persistent {
    display: flex;
    gap:     8px;
}

/* ── Mobile Anpassungen ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .ewsm-timeline-controls {
        padding: 5px 10px;
        gap:     7px;
    }
    .ewsm-tl-scrubber-wrap {
        width: 100px;
    }
}
