/* Webinar Live — giao diện landing + phòng xem */

.wlb-landing {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
}

.wlb-landing__title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.wlb-landing__content {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.wlb-landing__form h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.wlb-landing__already {
    color: #50575e;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.wlb-landing__form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.wlb-input {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 0.75rem;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 1rem;
}

.wlb-btn {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    background: #f0f0f1;
    color: #1d2327;
}

.wlb-btn--primary {
    background: #2271b1;
    color: #fff;
}

.wlb-btn--primary:hover {
    background: #135e96;
    color: #fff;
}

.wlb-landing__msg {
    color: #b32d2e;
}

.wlb-join-link {
    word-break: break-all;
}

/* Phòng webinar */
.wlb-room {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.wlb-end-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
}

/* Không được ghi đè [hidden]: nếu không, overlay “kết thúc” luôn hiện trước giờ. */
.wlb-end-overlay[hidden] {
    display: none !important;
}

.wlb-end-overlay__box {
    max-width: 420px;
}

.wlb-end-overlay__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1d2327;
}

.wlb-end-overlay__sub {
    margin: 0;
    color: #50575e;
    font-size: 1rem;
}

.wlb-room--ended .wlb-live-badge,
.wlb-room--ended .wlb-viewers {
    visibility: hidden;
}

.wlb-room--ended .wlb-chat__form {
    pointer-events: none;
    opacity: 0.5;
}

.wlb-video-wrap.wlb-is-playing .wlb-video--livestream {
    pointer-events: none;
    user-select: none;
}

/* Trước giờ: ẩn video + chat (kèm thuộc tính hidden từ PHP/JS) */
.wlb-room--waiting .wlb-room__stage {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.wlb-room--waiting .wlb-room__countdown {
    position: relative;
    z-index: 2;
}

.wlb-room--live .wlb-room__stage {
    display: grid !important;
    visibility: visible !important;
}

.wlb-room--live .wlb-room__countdown[hidden],
.wlb-room--live .wlb-room__countdown {
    display: none !important;
}

.wlb-room__title {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.wlb-room__schedule {
    color: #50575e;
    margin: 0 0 1rem;
}

.wlb-room__countdown {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(145deg, #1e1e2e 0%, #2d2d44 100%);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.wlb-countdown__label {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    opacity: 0.9;
}

.wlb-countdown__digits {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.wlb-room__stage {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 900px) {
    .wlb-room__stage {
        grid-template-columns: 1fr;
    }
}

.wlb-video-wrap {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.wlb-video-wrap .wlb-room__autoplay-hint {
    position: absolute;
    inset: 0;
    margin: auto;
    height: fit-content;
    width: 90%;
    max-width: 420px;
    text-align: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    z-index: 15;
    pointer-events: auto;
    font-size: 0.95rem;
}

.wlb-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.wlb-live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: #e00;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    animation: wlb-pulse 2s ease-in-out infinite;
}

@keyframes wlb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.wlb-viewers {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.875rem;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wlb-chat {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 520px);
    min-height: 280px;
}

.wlb-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.wlb-chat__line {
    margin-bottom: 0.65rem;
    word-break: break-word;
}

.wlb-chat__line strong {
    color: #2271b1;
}

.wlb-chat__form {
    padding: 0.75rem;
    border-top: 1px solid #dcdcde;
    background: #fff;
}

.wlb-chat__row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wlb-input--sm {
    max-width: 100%;
    margin-bottom: 0;
}

.wlb-chat__form .wlb-btn {
    flex-shrink: 0;
}
