/* Archive Video Layout */
.video-archive-container {
    padding: 30px 0;
    display: flex;
    flex-direction: column;
}

.video-main-content {
    margin-bottom: 15px;
    max-height: 400px;
    display: flex;
}

/* Danh mục video */
.video-categories-sidebar {
    padding-right: 20px;
    height: 100%;
}

.video-categories-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.video-categories-sidebar .sidebar-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaeaea;
    color: #333;
}

/* Video chính */
.featured-video {
    padding: 0 20px;
    height: 100%;
    display: flex;
}

.main-video-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-video-container iframe{
    max-width: 100%;
    height: 100%;
}
.main-video-container video {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    margin: auto;
}


.video-title {
    font-weight: bold;
    font-size: 16px;
    line-height: 22px;
    color: #000000;
    text-align: left;
    margin-bottom: 15px;
}

.video-content {
    margin-bottom: 15px;
    line-height: 1.6;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Thông tin phải */
.video-info-sidebar {
    padding-left: 20px;
    height: 400px;
}
.video-categories ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 15px;
}

.video-categories li {
    margin-bottom: 5px;
}

.video-categories a {
    color: #0073aa;
    text-decoration: none;
}

.video-categories a:hover {
    text-decoration: underline;
}

.total-videos {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Danh sách video */
.video-list-section{
    padding: 15px;
    border-top: 1px solid #d6d6d6;
    width: 100%;
}
.video-list-title {
    display: block;
    position: relative;
    padding-left: 30px;
    font-weight: bold;
    color: #000000;
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    line-height: 1.6;
}
.video-list-title::before {
    content: "";
    width: 0.8rem;
    height: 1.5rem;
    background-color: #00820c;
    position: absolute;
    left: 0;
    transform: translateY(-50%);
    top: 50%;
}
.tax-video_category .video-grid,
.single-video .video-grid,
.post-type-archive-video .video-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 15px 0;
}
.tax-video_category .video-grid .video-item,
.single-video .video-grid .video-item,
.post-type-archive-video .video-grid .video-item {
    width: calc(100% / 4 - 15px);
    height: auto;
    overflow: hidden;
    margin: 0 15px 15px 0;
}
.tax-video_category .video-grid .video-item-title,
.single-video .video-grid .video-item-title,
.post-type-archive-video .video-grid .video-item-title {
    font-weight: 600;
    color: #000000;
    text-align: left;
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: calc(1.4em * 2);
    font-size: 0.9rem;
}

.video-pagination {
    margin-top: 30px;
    text-align: center;
}

.no-videos,
.no-videos-message {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 5px;
}
/* Video Loading State */
.video-loading {
    padding: 50px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 5px;
    font-style: italic;
    color: #666;
}

.video-error {
    padding: 30px;
    text-align: center;
    background: #ffecec;
    border-radius: 5px;
    color: #d60000;
}

/* Video Info Box */
.video-info-box {
    background: #F1F1F1;
    border-radius: 5px;
    padding: 16px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.video-description {
    height: 300px;
    line-height: 1.5;
    overflow-y: auto;
    text-align: justify;
    padding-right: 0.5em;
}

.video-description::-webkit-scrollbar {
    width: 6px;
}
.video-description::-webkit-scrollbar-track {
    background: #eee;
}
.video-description::-webkit-scrollbar-thumb {
    background-color: #0e8800;
    border-radius: 4px;
}

/* Active Video Item */
.video-item[data-video-id="<?php echo $current_video_id; ?>"] {
    border: 2px solid #0073aa;
    position: relative;
}

.video-item[data-video-id="<?php echo $current_video_id; ?>"]:after {
    content: 'Đang phát';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0073aa;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}
.load-more-videos-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
}

.load-more-button {
    background: transparent;
    padding: 10px ;
    font-size: 12px ;
    border: 0;
    border-radius: 4px;
    font-weight: bold ;
    text-transform: uppercase ;
    color: #FE0001;
    outline: none;
    box-shadow: none ;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    flex-direction: column;
}
.load-more-button i{
    margin: 10px 0;

}

.load-more-button:hover {
    color: #0b6900;
}

.load-more-button.loading {
    color: #007c0f;
    cursor: not-allowed;
}

.load-more-button.loading:after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}
.video-list-title{
    display: flex;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
.video-category-section {
    border-top: 1px solid #d6d6d6;
    padding: 15px 0;
    width: 100%;
}
.category-video-grid{
    display: flex;
    flex-wrap: wrap;
    margin: 15px 0;
}
.category-video-grid .video-item{
    width: calc(100% / 4 - 15px);
    height: auto;
    overflow: hidden;
    margin: 0 15px 15px 0;
}
.category-video-grid .video-item .video-item-title {
    font-weight: 600;
    color: #000000;
    text-align: left;
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: calc(1.4em * 2);
    font-size: 0.9rem;
}
/* Responsive */
@media (max-width: 992px) {
    .video-categories-sidebar{
        display: none;
    }

    .term-info-box,
    .video-info-box {
        flex: 1;
    }
    .featured-video{
        width: 60%;
    }
    .video-info-sidebar {
        width: 40%;
    }
    .tax-video_category .video-grid .video-item, .single-video .video-grid .video-item, .post-type-archive-video .video-grid .video-item {
        width: calc(100% / 3 - 15px);
    }
    .video-category-section {
        padding: 15px 10px;
    }
    .category-video-grid .video-item{
        width: calc(100% / 3 - 15px);
    }
}

@media (max-width: 768px) {
    .video-main-content {
        flex-wrap: wrap;
        height: auto !important;
        max-height: none;
    }
    .featured-video,
    .video-info-sidebar {
        width: 100%;
        margin-bottom: 20px;
        height: auto;
    }
    .video-description {
        height: auto;
        line-height: 1.5;
        overflow-y: auto;
        text-align: justify;
        padding-right: 0.5em;
    }

    .video-info-sidebar {
        flex-direction: column;
    }
    .tax-video_category .video-grid .video-item,
    .single-video .video-grid .video-item,
    .post-type-archive-video .video-grid .video-item {
        width: calc(100% / 2 - 15px);
    }
    .category-video-grid .video-item{
        width: calc(100% / 2 - 15px);
    }
}