/**
 * Live-Stream Styles für Event-Slideshow
 * Fullscreen-Overlay für Live-Übertragungen
 */

/* ========================================
   Fullscreen Overlay
   ======================================== */

.live-stream-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 10000;
    display: none; /* Standardmäßig versteckt */
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ========================================
   Video Container
   ======================================== */

.live-stream-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-stream-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* ========================================
   Live Badge (pulsierend)
   ======================================== */

.live-stream-badge {
    position: absolute;
    top: 30px;
    left: 30px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

.live-pulse {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(220, 53, 69, 0.6);
    }
}

/* ========================================
   Viewer Count
   ======================================== */

.live-stream-viewers {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 1rem;
    display: none; /* Wird via JS eingeblendet */
    align-items: center;
    gap: 8px;
}

.live-stream-viewers i {
    font-size: 1.2rem;
}

/* ========================================
   Quality Badge
   ======================================== */

.live-stream-quality {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .live-stream-badge {
        top: 20px;
        left: 20px;
        font-size: 1rem;
        padding: 10px 16px;
    }

    .live-stream-viewers {
        top: 20px;
        right: 20px;
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    .live-stream-quality {
        bottom: 20px;
        right: 20px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ========================================
   Loading State
   ======================================== */

.live-stream-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
}

.live-stream-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.live-stream-loading p {
    margin-top: 20px;
    font-size: 1.1rem;
}

/* ========================================
   Error State
   ======================================== */

.live-stream-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
}

.live-stream-error i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.live-stream-error h3 {
    margin-bottom: 10px;
}

.live-stream-error p {
    opacity: 0.9;
    line-height: 1.5;
}

/* ========================================
   Controls Overlay (optional)
   ======================================== */

.live-stream-controls {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.live-stream-overlay:hover .live-stream-controls {
    opacity: 1;
}

.live-stream-control-btn {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.5rem;
}

.live-stream-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ========================================
   Transitions
   ======================================== */

.live-stream-overlay.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.live-stream-overlay.fade-out {
    animation: fadeOut 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========================================
   Connection Quality Indicator
   ======================================== */

.live-stream-connection-quality {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
}

.connection-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.connection-bar {
    width: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: background 0.3s;
}

.connection-bar:nth-child(1) {
    height: 8px;
}

.connection-bar:nth-child(2) {
    height: 12px;
}

.connection-bar:nth-child(3) {
    height: 16px;
}

.connection-bar:nth-child(4) {
    height: 20px;
}

/* Quality States */
.connection-quality-excellent .connection-bar {
    background: #28a745;
}

.connection-quality-good .connection-bar:nth-child(-n+3) {
    background: #ffc107;
}

.connection-quality-poor .connection-bar:nth-child(-n+2) {
    background: #dc3545;
}

/* ========================================
   Buffering Overlay
   ======================================== */

.live-stream-buffering {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 10px;
    color: white;
    display: none;
}

.live-stream-buffering.active {
    display: block;
}

.buffering-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
