/* ==========================================================================
   SoftVide - Watch Page
   ========================================================================== */

.watch-page {
    width: 100%;
    color: var(--text-primary);
}


/* ==========================================================================
   Main Layout
   ========================================================================== */

.watch-layout {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        380px;

    gap: 24px;

    align-items: start;
}


/* ==========================================================================
   Main Video Column
   ========================================================================== */

.watch-main {
    min-width: 0;
}

.watch-player {
    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #000;

    border-radius: 10px;
}

.watch-video {
    display: block;

    width: 100%;
    height: 100%;

    background: #000;

    object-fit: contain;
}


/* ==========================================================================
   Video Information
   ========================================================================== */

.watch-info {
    padding-top: 16px;
}

.watch-title {
    margin: 0;

    color: var(--text-primary);

    font-size: 20px;
    font-weight: 700;

    line-height: 1.4;
}

.watch-meta {
    margin-top: 8px;

    color: var(--text-secondary);

    font-size: 14px;
}

.watch-channel {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 14px;

    color: var(--text-primary);

    font-size: 14px;
}

.watch-channel strong {
    font-weight: 600;
}

.watch-channel span {
    color: var(--text-secondary);
}

.watch-description {
    margin-top: 16px;

    padding: 14px;

    background: var(--bg-secondary);

    border-radius: 10px;

    color: var(--text-primary);

    font-size: 14px;

    line-height: 1.6;
}


/* ==========================================================================
   Right Sidebar
   ========================================================================== */

.watch-sidebar {
    min-width: 0;
}


/* ==========================================================================
   Live / Playlist Top Panel
   ========================================================================== */

.watch-sidebar-top {
    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: var(--bg-secondary);

    border: 1px solid var(--border-color);

    border-radius: 10px;
}

.watch-sidebar-panel {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
}

.watch-sidebar-heading {
    flex: 0 0 auto;

    padding: 12px 14px;

    color: var(--text-primary);

    font-size: 16px;
    font-weight: 700;

    border-bottom: 1px solid var(--border-color);
}


/* ==========================================================================
   Live Comments
   ========================================================================== */

.live-comments-list {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding: 10px;
}

.watch-sidebar-loading {
    flex: 0 0 auto;

    padding: 10px 14px;

    color: var(--text-secondary);

    font-size: 13px;

    border-top: 1px solid var(--border-color);
}


/* ==========================================================================
   Playlist
   ========================================================================== */

.playlist-list {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding: 8px;
}

.playlist-video {
    display: flex;

    gap: 10px;

    width: 100%;

    padding: 7px;

    color: var(--text-primary);

    text-decoration: none;

    border-radius: 8px;

    box-sizing: border-box;
}

.playlist-video:hover {
    background: var(--hover-bg);
}

.playlist-thumbnail {
    width: 120px;
    height: 68px;

    flex: 0 0 120px;

    overflow: hidden;

    background: var(--bg-tertiary);

    border-radius: 6px;
}

.playlist-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.playlist-thumbnail-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-secondary);

    font-size: 18px;
}

.playlist-video-info {
    min-width: 0;
}

.playlist-video-title {
    color: var(--text-primary);

    font-size: 13px;
    font-weight: 600;

    line-height: 1.4;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* ==========================================================================
   Recommended Videos
   ========================================================================== */

.watch-recommended {
    width: 100%;

    margin-top: 20px;
}

.recommended-list {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 12px;

    margin-top: 10px;
}

.recommended-video {
    display: flex;

    gap: 10px;

    width: 100%;

    color: var(--text-primary);

    text-decoration: none;
}

.recommended-thumbnail {
    width: 150px;
    height: 84px;

    flex: 0 0 150px;

    overflow: hidden;

    background: var(--bg-tertiary);

    border-radius: 8px;
}

.recommended-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.recommended-thumbnail-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-secondary);

    font-size: 18px;
}

.recommended-info {
    min-width: 0;
}

.recommended-title {
    color: var(--text-primary);

    font-size: 14px;
    font-weight: 600;

    line-height: 1.4;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.recommended-channel {
    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 12px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.recommended-meta {
    margin-top: 3px;

    color: var(--text-secondary);

    font-size: 12px;
}


/* ==========================================================================
   Infinite Scroll
   ========================================================================== */

.recommended-scroll-sentinel {
    width: 100%;
    height: 1px;
}

.recommended-loading {
    padding: 16px;

    color: var(--text-secondary);

    font-size: 13px;

    text-align: center;
}


/* ==========================================================================
   Scrollbars
   ========================================================================== */

.playlist-list,
.live-comments-list {
    scrollbar-width: thin;
}

.playlist-list::-webkit-scrollbar,
.live-comments-list::-webkit-scrollbar {
    width: 6px;
}

.playlist-list::-webkit-scrollbar-thumb,
.live-comments-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);

    border-radius: 10px;
}


/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 1100px) {

    .watch-layout {
        grid-template-columns:
            minmax(0, 1fr)
            320px;

        gap: 18px;
    }

    .recommended-thumbnail {
        width: 120px;
        height: 68px;

        flex-basis: 120px;
    }

}


/* ==========================================================================
   Small Tablet
   ========================================================================== */

@media (max-width: 850px) {

    .watch-layout {
        grid-template-columns: 1fr;
    }

    .watch-sidebar-top {
        aspect-ratio: auto;

        min-height: 300px;
    }

    .recommended-thumbnail {
        width: 180px;
        height: 101px;

        flex-basis: 180px;
    }

}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 600px) {

    .watch-layout {
        gap: 16px;
    }

    .watch-player {
        border-radius: 0;
    }

    .watch-title {
        font-size: 18px;
    }

    .watch-sidebar-top {
        min-height: 260px;
    }

    .recommended-thumbnail {
        width: 140px;
        height: 79px;

        flex-basis: 140px;
    }

    .recommended-title {
        font-size: 13px;
    }

}