/* Video section — YouTube-inspired layout */

.video-page-wrapper {
    width: 100%;
}

.video-page-wrapper--list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.video-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--site-sidebar-width, 260px);
    gap: var(--site-layout-gap, 20px);
    align-items: start;
}

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

.video-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: #f8f9fb;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #444;
}

.video-list-meta__count {
    margin-left: auto;
    color: #606060;
    font-weight: 500;
}

.video-list-meta__clear {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.video-list-meta__clear:hover {
    text-decoration: underline;
}

/* Video category list in sidebar: unified in site-theme.css */
.video-category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: #4b5563;
    font-size: 0.78rem;
    line-height: 1.35;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.video-category-link.is-child {
    padding-left: 14px;
    font-size: 0.74rem;
}

.video-category-link:hover,
.video-category-link.active {
    background: #e8f4f8;
    color: #0d6b72;
}

.video-category-count {
    font-size: 0.68rem;
    color: #6b7280;
    background: #f1f3f5;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}

.video-category-link.active .video-category-count {
    background: rgba(13, 107, 114, 0.12);
    color: #0d6b72;
}

.video-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.video-section__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #0f0f0f;
}

.video-section__count {
    font-size: 0.9rem;
    color: #606060;
}

.video-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

.video-card--featured {
    min-width: 0;
}

.video-card--featured .video-card__body {
    padding: 8px 10px 10px;
    gap: 4px;
}

.video-card--featured .video-card__title {
    font-size: 0.86rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
}

.video-card--featured .video-card__category {
    font-size: 0.72rem;
}

.video-card--featured .video-card__stats {
    gap: 6px;
    font-size: 0.68rem;
}

.video-card--featured .video-card__play-badge {
    width: 22px;
    height: 22px;
    font-size: 0.58rem;
    right: 6px;
    bottom: 6px;
}

.video-grid--compact {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px 14px;
}

.video-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e5e5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.video-card--featured .video-card__thumb {
    aspect-ratio: 16 / 9;
}

.video-card--compact {
    flex-direction: column;
    min-height: 0;
}

.video-card--compact .video-card__thumb {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    min-height: 0;
}

.video-card--compact .video-card__body {
    padding: 8px 10px 10px;
    justify-content: flex-start;
    gap: 4px;
}

.video-card--compact .video-card__title {
    font-size: 0.84rem;
    line-height: 1.35;
    -webkit-line-clamp: 3;
}

.video-card--compact .video-card__category {
    font-size: 0.74rem;
}

.video-card--compact .video-card__stats {
    gap: 8px;
    font-size: 0.72rem;
}

.video-card--compact .video-card__play-badge {
    width: 24px;
    height: 24px;
    font-size: 0.62rem;
}

.video-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #0f0f0f;
    overflow: hidden;
}

.video-card__thumb img,
.video-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-card__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #2b2b2b, #111);
}

.video-card__play-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.video-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
    min-width: 0;
}

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

.video-card__category {
    font-size: 0.8rem;
    color: #606060;
}

.video-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: #606060;
}

.video-card__stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.video-empty {
    text-align: center;
    padding: 72px 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.video-empty i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 16px;
}

.video-empty h2 {
    margin: 0 0 8px;
    color: #444;
}

.video-empty p {
    margin: 0;
    color: #777;
}

/* Detail page */

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

.video-detail-main {
    min-width: 0;
}

.video-player-shell {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.video-detail-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.video-player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bbb;
    gap: 8px;
}

.video-action-btn--download:hover {
    background: #e8f4ff;
    border-color: #9ec5fe;
    color: #0b5ed7;
}

.video-action-btn--download.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.video-detail-info {
    padding: 14px 2px 0;
}

.video-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

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

.video-detail-title {
    margin: 0;
    min-width: 0;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    line-height: 1.35;
    color: #0f0f0f;
}

.video-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: #606060;
}

.video-detail-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.video-detail-meta__item--category {
    background: #eef4ff;
    color: #1a56db;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
}

.video-detail-description {
    color: #303030;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: normal;
}

.video-detail-description p {
    margin: 0 0 0.75em;
}

.video-detail-description p:last-child {
    margin-bottom: 0;
}

.video-detail-description ul,
.video-detail-description ol {
    margin: 0 0 0.75em;
    padding-left: 1.4em;
}

.video-detail-description a {
    color: #1a56db;
    text-decoration: underline;
}

.video-detail-description img {
    max-width: 100%;
    height: auto;
}

.video-detail-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #606060;
    margin-bottom: 16px;
}

.video-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    max-width: 52%;
}

.video-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d0d0d0;
    background: #f8f8f8;
    color: #0f0f0f;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.video-action-btn:hover {
    background: #efefef;
}

.video-action-btn--like.is-liked,
.video-action-btn--like.is-liked:hover {
    background: #ffe8ee;
    border-color: #f5b8c8;
    color: #c2185b;
}

.video-action-btn__count {
    font-variant-numeric: tabular-nums;
}

.video-detail-sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow: auto;
    padding-right: 4px;
}

.video-detail-sidebar__section + .video-detail-sidebar__section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #ececec;
}

.video-detail-sidebar__title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f0f0f;
}

.video-detail-now-playing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: #606060;
}

.video-detail-now-playing i {
    color: #c2185b;
}

.video-detail-playlist__hint {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: #777;
}

.video-playlist-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.video-playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
    color: #0f0f0f;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-playlist-item:hover {
    background: #f0f0f0;
    border-color: #d8d8d8;
}

.video-playlist-item.is-active {
    background: #fff4f7;
    border-color: #f0b8c8;
    box-shadow: 0 0 0 1px rgba(194, 24, 91, 0.08);
}

.video-playlist-item__index {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ececec;
    color: #444;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.video-playlist-item.is-active .video-playlist-item__index {
    background: #c2185b;
    color: #fff;
}

.video-playlist-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-playlist-item__label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-playlist-item__file {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-playlist-item__icon {
    flex-shrink: 0;
    color: #888;
    font-size: 0.72rem;
}

.video-playlist-item.is-active .video-playlist-item__icon {
    color: #c2185b;
}

.video-detail-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-detail-sidebar__empty {
    margin: 0;
    color: #777;
    font-size: 0.9rem;
}

.video-sidebar-item {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

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

.video-sidebar-item__thumb {
    width: 112px;
    min-width: 112px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
}

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

.video-sidebar-item__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #333;
}

.video-sidebar-item__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.video-sidebar-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: #606060;
}

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

@media (max-width: 1200px) {
    .video-page-layout {
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: 18px;
    }

    .video-featured-grid {
        gap: 8px 10px;
    }

    .video-grid--compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .video-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 1100px) {
    .video-grid--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .video-detail-layout {
        grid-template-columns: 1fr;
    }

    .video-detail-sidebar {
        position: static;
        max-height: none;
    }
}

@media (max-width: 900px) {
    .video-page-layout {
        grid-template-columns: 1fr;
    }

    .video-sidebar {
        position: static;
    }

    .video-sidebar-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .video-grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .video-sidebar-panel {
        grid-template-columns: 1fr;
    }

    .video-list-meta__count {
        margin-left: 0;
        width: 100%;
    }

    .video-featured-grid {
        grid-template-columns: 1fr;
    }

    .video-grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

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

    .video-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .video-detail-actions {
        max-width: none;
        justify-content: flex-start;
    }

    .video-action-btn {
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .video-grid--compact {
        grid-template-columns: 1fr;
    }
}
