/* Internal webinar chat – scoped to .vitd-chat so it works on every site. */

.vitd-chat {
    --vitd-chat-accent: #fa891b;
    --vitd-chat-bg: #262626;
    --vitd-chat-panel: #313131;
    --vitd-chat-bubble: #3a3a3a;
    --vitd-chat-border: rgba(255, 255, 255, 0.14);
    --vitd-chat-text: #ffffff;
    --vitd-chat-muted: rgba(255, 255, 255, 0.62);

    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 440px;
    overflow: hidden;
    background: var(--vitd-chat-bg);
    border: 1px solid var(--vitd-chat-border);
    border-radius: 6px;
    color: var(--vitd-chat-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
}

.vitd-chat *,
.vitd-chat *::before,
.vitd-chat *::after {
    box-sizing: border-box;
}

.vitd-chat [hidden] {
    display: none !important;
}

.vitd-chat button,
.vitd-chat input,
.vitd-chat textarea {
    font-family: inherit;
    font-size: inherit;
}

.vitd-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
    padding: 12px 14px;
    background: var(--vitd-chat-panel);
    border-bottom: 1px solid var(--vitd-chat-border);
}

.vitd-chat__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.vitd-chat__live-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--vitd-chat-accent);
    box-shadow: 0 0 0 4px rgba(250, 137, 27, 0.16);
}

.vitd-chat__title {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

.vitd-chat__status {
    overflow: hidden;
    color: var(--vitd-chat-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vitd-chat__status[data-state="live"] {
    color: #7ddc8a;
}

.vitd-chat__status[data-state="ended"],
.vitd-chat__status[data-state="error"] {
    color: #ff9d8a;
}

.vitd-chat__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.vitd-chat__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--vitd-chat-muted);
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.vitd-chat__icon-button:hover,
.vitd-chat__icon-button:focus-visible {
    border-color: var(--vitd-chat-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--vitd-chat-text);
    text-decoration: none;
}

.vitd-chat__icon-button.is-active {
    color: var(--vitd-chat-accent);
}

.vitd-chat__notice {
    flex: 0 0 auto;
    padding: 8px 14px;
    background: rgba(250, 137, 27, 0.14);
    border-bottom: 1px solid var(--vitd-chat-border);
    color: #ffd3a4;
    font-size: 13px;
}

.vitd-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 14px 6px;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    scrollbar-width: thin;
}

.vitd-chat__messages::-webkit-scrollbar {
    width: 8px;
}

.vitd-chat__messages::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
}

.vitd-chat__empty {
    flex: 0 0 auto;
    padding: 0 14px 14px;
    color: var(--vitd-chat-muted);
    font-size: 13px;
}

.vitd-chat__message {
    padding: 7px 0;
}

.vitd-chat__message-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 3px;
}

.vitd-chat__author {
    overflow: hidden;
    max-width: 70%;
    color: var(--vitd-chat-accent);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vitd-chat__time {
    color: var(--vitd-chat-muted);
    font-size: 11px;
}

.vitd-chat__pinned-label {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(250, 137, 27, 0.2);
    color: #ffd3a4;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vitd-chat__message-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.vitd-chat__message:hover .vitd-chat__message-actions,
.vitd-chat__message:focus-within .vitd-chat__message-actions {
    opacity: 1;
}

@media (hover: none) {
    .vitd-chat__message-actions {
        opacity: 1;
    }
}

.vitd-chat__message-action {
    padding: 2px 5px;
    border: 1px solid var(--vitd-chat-border);
    border-radius: 3px;
    background: transparent;
    color: var(--vitd-chat-muted);
    font-size: 10px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.vitd-chat__message-action:hover,
.vitd-chat__message-action:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: var(--vitd-chat-text);
}

.vitd-chat__bubble {
    display: inline-block;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 2px 9px 9px 9px;
    background: var(--vitd-chat-bubble);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.vitd-chat__message--own .vitd-chat__bubble {
    background: rgba(250, 137, 27, 0.16);
    border: 1px solid rgba(250, 137, 27, 0.28);
}

.vitd-chat__message--moderator .vitd-chat__author {
    color: #ffb257;
}

.vitd-chat__message--moderator .vitd-chat__bubble {
    background: rgba(250, 137, 27, 0.23);
    border: 1px solid rgba(250, 137, 27, 0.36);
}

.vitd-chat__message--system {
    padding: 10px 0;
    text-align: center;
}

.vitd-chat__system-text {
    display: inline-block;
    padding: 7px 12px;
    border: 1px dashed rgba(250, 137, 27, 0.45);
    border-radius: 5px;
    color: #ffd3a4;
    font-size: 13px;
    white-space: pre-wrap;
}

.vitd-chat__replies {
    margin: 6px 0 0 20px;
    padding-left: 12px;
    border-left: 2px solid rgba(250, 137, 27, 0.32);
}

.vitd-chat__message--reply {
    padding: 4px 0;
}

.vitd-chat__message--reply .vitd-chat__bubble {
    background: rgba(255, 255, 255, 0.07);
    font-size: 14px;
}

.vitd-chat__moderation,
.vitd-chat__moderation-bar {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-top: 1px solid var(--vitd-chat-border);
    background: var(--vitd-chat-panel);
}

.vitd-chat__moderation-title {
    margin: 0 0 6px;
    color: var(--vitd-chat-muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vitd-chat__moderation-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vitd-chat__moderation-row input {
    flex: 1 1 130px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid var(--vitd-chat-border);
    border-radius: 4px;
    background: #1f1f1f;
    color: var(--vitd-chat-text);
}

.vitd-chat__moderation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--vitd-chat-muted);
    font-size: 12px;
}

.vitd-chat__moderation-bar strong {
    color: var(--vitd-chat-accent);
}

.vitd-chat__button {
    padding: 6px 12px;
    border: 1px solid var(--vitd-chat-accent);
    border-radius: 4px;
    background: var(--vitd-chat-accent);
    color: #1c1c1c;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}

.vitd-chat__button--ghost {
    background: transparent;
    color: var(--vitd-chat-text);
}

.vitd-chat__link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--vitd-chat-muted);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.vitd-chat__link-button:hover,
.vitd-chat__link-button:focus-visible {
    color: var(--vitd-chat-text);
}

.vitd-chat__form {
    flex: 0 0 auto;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--vitd-chat-border);
    background: var(--vitd-chat-panel);
}

.vitd-chat__reply {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-left: 2px solid var(--vitd-chat-accent);
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
}

.vitd-chat__reply-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--vitd-chat-muted);
}

.vitd-chat__reply blockquote {
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    color: var(--vitd-chat-muted);
    font-size: 12px;
}

.vitd-chat__identity {
    margin-bottom: 6px;
}

.vitd-chat__identity input {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--vitd-chat-border);
    border-radius: 4px;
    background: #1f1f1f;
    color: var(--vitd-chat-text);
    font-size: 13px;
}

.vitd-chat__compose {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.vitd-chat__compose textarea {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 46px;
    max-height: 130px;
    padding: 8px 9px;
    resize: vertical;
    border: 1px solid var(--vitd-chat-border);
    border-radius: 4px;
    background: #1f1f1f;
    color: var(--vitd-chat-text);
    font-size: 14px;
    line-height: 1.4;
}

.vitd-chat__compose textarea::placeholder,
.vitd-chat__identity input::placeholder,
.vitd-chat__moderation-row input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

/*
 * Einige Sites setzen per globalem Formular-Styling schwarze Textfarbe auf
 * input[type="text"] und textarea. Diese Regeln müssen hier höher spezifiziert
 * werden, sonst ist der eigene Nickname im dunklen Chat nicht lesbar.
 */
.vitd-chat .vitd-chat__form .vitd-chat__identity input,
.vitd-chat .vitd-chat__form .vitd-chat__compose textarea,
.vitd-chat .vitd-chat__moderation .vitd-chat__moderation-row input {
    color: var(--vitd-chat-text);
    -webkit-text-fill-color: var(--vitd-chat-text);
}

.vitd-chat .vitd-chat__form .vitd-chat__identity input::placeholder,
.vitd-chat .vitd-chat__form .vitd-chat__compose textarea::placeholder,
.vitd-chat .vitd-chat__moderation .vitd-chat__moderation-row input::placeholder {
    color: rgba(255, 255, 255, 0.42);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.42);
}

.vitd-chat__compose textarea:focus,
.vitd-chat__identity input:focus,
.vitd-chat__moderation-row input:focus {
    border-color: var(--vitd-chat-accent);
    outline: 2px solid rgba(250, 137, 27, 0.25);
    outline-offset: 0;
}

.vitd-chat__send {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    background: var(--vitd-chat-accent);
    color: #1c1c1c;
    font-weight: 700;
    cursor: pointer;
}

.vitd-chat__send:hover,
.vitd-chat__send:focus-visible {
    background: #ffa03f;
}

.vitd-chat__send:disabled,
.vitd-chat__compose textarea:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.vitd-chat__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
    color: var(--vitd-chat-muted);
    font-size: 11px;
}

.vitd-chat__meta .is-over,
.vitd-chat__error {
    color: #ff9d8a;
}

.vitd-chat__error {
    font-size: 12px;
}

.vitd-chat__toast {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 5;
    padding: 9px 12px;
    border: 1px solid rgba(250, 137, 27, 0.45);
    border-radius: 5px;
    background: #1c1c1c;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--vitd-chat-text);
    font-size: 13px;
    pointer-events: none;
}

.vitd-chat {
    position: relative;
}

.vitd-chat--moderator .vitd-chat__identity {
    display: none;
}

/* ------------------------------------------------------------------
   Webinar detail: 75 % video / 25 % chat, chat over the full height
   ------------------------------------------------------------------ */

@media (min-width: 992px) {
    .webinar-detail .player.player--with-chat {
        display: flex;
        align-items: stretch;
        width: auto;
    }

    .webinar-detail .player.player--with-chat > .webinar-player__video,
    .webinar-detail .player.player--with-chat > .webinar-player__chat {
        float: none;
        padding-right: 10px;
        padding-left: 10px;
    }

    .webinar-detail .player.player--with-chat > .webinar-player__video {
        display: flex;
        flex-direction: column;
        width: 75%;
    }

    .webinar-detail .player.player--with-chat > .webinar-player__chat {
        display: flex;
        flex-direction: column;
        width: 25%;
        min-width: 0;
    }

    .webinar-detail .player.player--with-chat .webinar-player__video .embed-responsive {
        flex: 1 1 auto;
        height: 100%;
        min-height: 420px;
        padding-bottom: 0 !important;
    }

    .webinar-detail .player.player--with-chat .webinar-player__video .embed-responsive iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .webinar-detail .player.player--with-chat .webinar-player__chat .vitd-chat {
        height: calc(100vh - 210px);
        min-height: 520px;
    }

    .webinar-detail .player.player--with-chat .webinar-player__chat iframe.chat {
        width: 100%;
        height: calc(100vh - 210px);
        min-height: 520px;
    }
}

@media (max-width: 991px) {
    .webinar-detail .player--with-chat .webinar-player__chat {
        margin-top: 24px;
    }

    .webinar-detail .player--with-chat .webinar-player__chat .vitd-chat {
        height: 70vh;
        min-height: 440px;
    }

    .webinar-detail .player--with-chat .webinar-player__chat iframe.chat {
        width: 100%;
        height: 70vh;
        min-height: 440px;
    }
}

@media (min-width: 992px) {
    .webinar-detail .player.player--chat-ended {
        display: block;
    }

    .webinar-detail .player.player--chat-ended .webinar-player__video {
        width: 100%;
    }

    .webinar-detail .player.player--chat-ended .webinar-player__chat {
        display: none;
    }
}

.webinar-detail .playlists-row {
    margin-top: 30px;
}

.webinar-detail .webinar-player-fluid {
    display: flow-root;
}

.webinar-detail .webinar-chat-popout-link {
    margin: 6px 0 0;
    text-align: right;
}

.webinar-detail .webinar-chat-popout-link a {
    color: var(--vitd-chat-accent, #fa891b);
    font-size: 12px;
}

/* Standalone popout window */

body.vitd-chat-popout {
    height: 100vh;
    margin: 0;
    overflow: hidden;
    background: #1f1f1f;
}

.vitd-chat-popout__inner {
    height: 100vh;
}

.vitd-chat-popout .vitd-chat {
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
}
