/* Live stream page */

.live-page-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
}

.live-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.live-page-main {
    min-width: 0;
}

/* ===== Player shell ===== */

.live-player-shell {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #0a0a0a;
    box-shadow:
        0 14px 42px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.live-player-shell--offline {
    min-height: 300px;
    display: flex;
    align-items: stretch;
    background: #f8f9fb;
    border: 1px dashed #d5d9e0;
    box-shadow: none;
}

.live-player-overlay {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    pointer-events: none;
}

.live-player-overlay__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(185, 28, 28, 0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.live-player-overlay__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: live-pulse-dot 1.8s ease-out infinite;
}

@keyframes live-pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.live-stream-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(72vh, 760px);
    background: #000;
}

.live-stream-embed__iframe,
.live-stream-embed__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
    object-fit: contain;
}

.live-stream-embed__error {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.9);
}

.live-stream-embed__error[hidden] {
    display: none !important;
}

.live-stream-embed__error i {
    font-size: 1.6rem;
    color: #fbbf24;
}

.live-stream-embed__error p {
    margin: 0;
    max-width: 36ch;
    line-height: 1.5;
    font-size: 0.95rem;
}

.live-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    color: #555;
}

.live-empty i {
    font-size: 2rem;
    color: #9aa3af;
    margin-bottom: 12px;
}

.live-empty h2 {
    margin: 0 0 8px;
    color: #333;
    font-size: 1.25rem;
}

.live-empty p {
    margin: 0;
    max-width: 36ch;
    line-height: 1.5;
}

/* ===== Info panel ===== */

.live-detail-info {
    margin-top: 16px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
    border: 1px solid #e4e7eb;
    border-radius: 12px;
}

.live-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.live-detail-header__text {
    flex: 1;
    min-width: 0;
}

.live-detail-title {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    line-height: 1.3;
    color: #0f0f0f;
}

.live-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #b91c1c;
}

.live-detail-status__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #dc2626;
    animation: live-pulse-dot 1.8s ease-out infinite;
}

.live-detail-description {
    margin: 0;
    color: #444;
    line-height: 1.6;
    font-size: 0.95rem;
    max-width: 72ch;
}

.live-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.live-share-btn.is-copied {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

/* ===== Sidebar ===== */

.live-sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 110px);
}

.live-sidebar__panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.live-sidebar__panel:first-child {
    flex: 1 1 50%;
    max-height: calc((100vh - 124px) / 2);
}

.live-sidebar__panel--gallery {
    flex: 1 1 50%;
    max-height: calc((100vh - 124px) / 2);
}

.live-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fb;
    border-bottom: 1px solid #eceff3;
}

.live-sidebar__header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.live-sidebar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 0.82rem;
}

.live-sidebar__icon--video {
    background: rgba(67, 56, 202, 0.1);
    color: var(--bmw-blue, #4338ca);
}

.live-sidebar__icon--gallery {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
}

.live-sidebar__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.live-sidebar__more {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bmw-blue, #4338ca);
    text-decoration: none;
    white-space: nowrap;
}

.live-sidebar__more:hover {
    text-decoration: underline;
}

.live-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

.live-sidebar__empty {
    margin: 8px 6px;
    color: #777;
    font-size: 0.88rem;
    line-height: 1.45;
}

.live-sidebar .video-sidebar-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.18s ease;
}

.live-sidebar .video-sidebar-item:hover {
    background: #f3f4f6;
}

.live-sidebar .video-sidebar-item__thumb {
    width: 118px;
    min-width: 118px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

.live-sidebar .video-sidebar-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-sidebar .live-sidebar-item--gallery .video-sidebar-item__thumb {
    aspect-ratio: 4 / 3;
}

.live-sidebar .video-sidebar-item__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #888;
    font-size: 1.1rem;
}

.live-sidebar .video-sidebar-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-top: 1px;
}

.live-sidebar .video-sidebar-item__title {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    color: #0f0f0f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.live-sidebar .video-sidebar-item__channel {
    font-size: 0.76rem;
    color: #606060;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-sidebar .video-sidebar-item__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.74rem;
    color: #606060;
}

.live-sidebar .video-sidebar-item__stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.live-sidebar .video-sidebar-item__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.live-sidebar .video-sidebar-item__stat i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.live-sidebar .video-sidebar-item__date {
    color: #888;
}

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

@media (max-width: 1100px) {
    .live-page-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .live-sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .live-sidebar__panel,
    .live-sidebar__panel--gallery,
    .live-sidebar__panel:first-child {
        max-height: 420px;
    }
}

@media (max-width: 768px) {
    .live-detail-header {
        flex-direction: column;
    }

    .live-detail-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .live-sidebar {
        grid-template-columns: 1fr;
    }

    .live-stream-embed {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .live-player-shell {
        border-radius: 10px;
    }

    .live-detail-info {
        padding: 14px;
    }

    .live-sidebar .video-sidebar-item__thumb {
        width: 100px;
        min-width: 100px;
    }
}
