/* LiveShow Reporter – Web
   Design 1:1 zur nativen RA-App (ReporterMainView.swift):
   Hintergrund schwarz, Akzent Cyan→Blau, LIVE/Auflegen rot, weiße Texte mit Opazität. */

:root {
    --cyan: #32d6e6;       /* SwiftUI .cyan ~ */
    --blue: #0a84ff;       /* SwiftUI .blue ~ */
    --red:  #ff3b30;       /* SwiftUI .red  ~ */
    --bg:   #000000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Author-display-Regeln (display:flex etc.) würden das [hidden]-Attribut sonst
   überschreiben. Erzwingt korrektes Aus-/Einblenden für Screens, Overlays, Fehler. */
[hidden] { display: none !important; }

html, body {
    height: 100%;
    background: var(--bg);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

#app { height: 100vh; height: 100dvh; }

/* ---------- Sprachumschalter (DE/EN) ---------- */

.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}
.lang-switch button {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s;
}
.lang-switch button.active {
    color: #fff;
    background: linear-gradient(to right, var(--cyan), var(--blue));
}

.screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px;
}

.dc-spacer { flex: 1 1 auto; }

/* ---------- Disconnected ---------- */

.dc-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.app-icon {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    object-fit: cover;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.app-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- Code-Eingabe (6 Felder) ---------- */

.code-input {
    display: flex;
    gap: 10px;
}

.code-input input {
    width: 44px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    outline: none;
    caret-color: var(--cyan);
    transition: border-color 0.15s, border-width 0.15s;
}

.code-input input:focus {
    border-color: var(--cyan);
    border-width: 2px;
}

/* ---------- Fehler ---------- */

.error-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--red);
    font-size: 15px;
    padding: 0 16px;
    text-align: center;
}
.error-icon { font-size: 16px; }

/* ---------- Connect-Button ---------- */

.btn-connect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    padding: 16px;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(to right, var(--cyan), var(--blue));
    transition: opacity 0.15s, filter 0.15s;
}
.btn-connect:disabled {
    background: linear-gradient(to right, #8e8e93, rgba(142, 142, 147, 0.5));
    cursor: not-allowed;
}
.btn-connect:not(:disabled):active { filter: brightness(0.9); }
.btn-connect-icon { font-size: 20px; }

/* ---------- QR-Button ---------- */

.btn-qr {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}
.btn-qr-icon { font-size: 18px; }

/* ---------- Connecting ---------- */

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.connecting-title { font-size: 22px; color: #fff; }
.connecting-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- Connected / LIVE ---------- */

.screen-live { padding: 0; gap: 0; position: relative; background: #000; }

.preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transform: scaleX(-1); /* Spiegelung wie typische Selfie-Vorschau */
}

.video-off {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: rgba(255, 255, 255, 0.3);
    background: #000;
    z-index: 5;
}

.format-hint {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    max-width: 80%;
    text-align: center;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
}

.live-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}
.live-overlay button { pointer-events: auto; }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 59, 48, 0.8);
    font-size: 14px;
    font-weight: 700;
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
    animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.timer {
    font-size: 16px;
    font-weight: 500;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
}

.bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-bottom: 40px;
}

.ctrl {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}
.ctrl svg { width: 26px; height: 26px; fill: currentColor; }
.ctrl.active {
    color: var(--cyan);
    border-color: rgba(50, 214, 230, 0.5);
}
.ctrl-end.active,
.ctrl-end {
    color: var(--red);
    border-color: rgba(255, 59, 48, 0.5);
}

/* ---------- QR-Modal ---------- */

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000;
}
.qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.qr-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 240px;
    height: 240px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
}
.qr-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    cursor: pointer;
}

/* Desktop: Vorschau nicht spiegeln wirkt bei Webcams natürlicher? RA spiegelt Front-Cam.
   Wir behalten Spiegelung nur für die LOKALE Vorschau – der gesendete Stream ist NICHT gespiegelt. */
