/* ==========================================================================
   AETHERLISM LIVE PLAYER & CHAT SYSTEM (FLUSH BLOCK SYSTEM) — KLINISCH
   ========================================================================== */

.stream-test-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
}

/* GANZER STREAM BLOCK */
.stream-grid-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    border: 1px solid rgba(var(--glass-tint-rgb), 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(var(--glass-tint-rgb), 0.14);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

/* HEADER */
.stream-header {
    width: 100%;
    padding: 18px 25px;
    box-sizing: border-box;
    background: rgba(var(--brand-primary-rgb), 0.9);
    color: #fff;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.live-indicator {
    font-size: 1rem;
    background: rgba(255, 0, 85, 0.2);
    border: 1px solid #ff0055;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ff0055;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff0055;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 0, 85, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

/* STREAM GRID (Player links, Chat rechts — exakt gleiche Höhe) */
.stream-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 0;
    align-items: stretch;
}

@media (max-width: 900px) {
    .stream-grid {
        grid-template-columns: 1fr;
    }
}

/* PLAYER-SPALTE (Video + Status/Toggle als eine Einheit) */
.player-glass {
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(var(--glass-tint-rgb), 0.25);
}

.video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

#live-player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    object-fit: contain;
    border: none;
}

/* BRANDING OVERLAY LEISTE */
.custom-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.video-wrapper:hover .custom-video-controls {
    opacity: 1;
}

/* BRANDING-BUTTON STYLING FÜR DIE CONTROLS */
.custom-video-controls .control-btn {
    color: #ffffff !important;
    background: transparent !important;
    padding: 8px 14px !important;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    position: relative;
    overflow: hidden;
    transition: color 0.1s linear,
                background 0.1s linear,
                letter-spacing 0.5s ease;
}

.custom-video-controls .control-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.8s ease;
}

/* Bugfix: war schwarzer Text auf dunklem --brand-primary-Hover — unlesbar */
.custom-video-controls .control-btn:hover {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    letter-spacing: 0.5px;
}

.custom-video-controls .control-btn:hover::before {
    left: 125%;
}

.control-spacer {
    flex: 1;
}

/* LAUTSTÄRKE SLIDER */
.volume-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

#custom-volume {
    appearance: none;
    -webkit-appearance: none;
    width: 70px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

#custom-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-secondary);
    cursor: pointer;
}

#custom-volume::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-secondary);
    border: none;
    cursor: pointer;
}

/* STATUS + TOGGLE UNTER DEM VIDEO */
.stream-controls {
    display: flex;
    gap: 0;
    margin-top: auto;
    align-items: stretch;
    border-top: 1px solid rgba(var(--glass-tint-rgb), 0.25);
}

.stream-status {
    flex: 1;
    padding: 14px 18px;
    box-sizing: border-box;
    background: rgba(var(--brand-primary-rgb), 0.35);
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

#stream-toggle {
    padding: 14px 25px;
    background: rgba(var(--glass-tint-rgb), 0.18);
    color: #0d3747;
    border: none;
    border-left: 1px solid rgba(var(--glass-tint-rgb), 0.25);
    font-family: 'Oswald', sans-serif;
    font-size: 1.0rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: color 0.1s linear,
                background 0.1s linear,
                letter-spacing 0.5s ease;
}

#stream-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.8s ease;
}

/* Bugfix: gleiche Ursache wie .control-btn — Text bleibt weiß im Hover */
#stream-toggle:hover {
    background: var(--brand-primary);
    color: #ffffff;
    letter-spacing: 1.5px;
}

#stream-toggle:hover::before {
    left: 125%;
}

/* CHAT BEREICH */
.chat-glass {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.2);
}

.chat-header {
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
}

.chat-msg {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 2px solid var(--brand-secondary);
    color: #ddd;
    word-break: break-word;
}

.chat-msg.system {
    border-color: #ff0055;
    font-style: italic;
    opacity: 0.8;
}

.msg-user {
    color: var(--brand-secondary);
    font-weight: bold;
}

.chat-input-wrapper {
    display: flex;
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    gap: 0;
    margin-top: auto;
}

#chat-input {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
}

#chat-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
}

/* Bugfix: war permanent schwarzer Text (color:#000) auf dunklem --brand-primary — 
   der Button-Text war quasi unsichtbar, nicht nur im Hover */
#chat-send {
    padding: 12px 20px;
    background: var(--brand-primary);
    border: none;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.1s linear;
}

#chat-send::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

#chat-send:hover {
    background: rgba(var(--brand-primary-rgb), 0.8);
}

#chat-send:hover::before {
    left: 125%;
}

/* ADMIN DELETE BUTTON */
.chat-del-btn {
    background: transparent;
    border: none;
    color: #ff5555;
    font-size: 0.75rem;
    cursor: pointer;
    margin-right: 4px;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity 0.15s linear;
}

.chat-del-btn:hover {
    opacity: 1;
    color: #ff0000;
}

.msg-time {
    opacity: 0.5;
    font-size: 0.75rem;
    margin-right: 4px;
}

/* FOOTER / DIVIDER */
.system-divider {
    width: 100%;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(var(--glass-tint-rgb), 0.15);
    opacity: 0.55;
    font-family: 'Roboto Mono', monospace;
    text-align: center;
    color: #fff;
}