/* YouTube-style Video Container */
.youtube-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.youtube-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.youtube-title {
    font-size: 28px;
    font-weight: 500;
    color: #0f0f0f;
}

.youtube-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e5e5e5;
    background: white;
    color: #606060;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #0f0f0f;
    color: white;
    border-color: #0f0f0f;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    margin-top: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 500;
    color: #0f0f0f;
}

.view-all-link {
    font-size: 14px;
    color: #065fd4;
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Short Videos Grid - Vertical/Scrollable Style (for homepage preview) */
#shorts-section .shorts-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 32px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

#shorts-section .shorts-container::-webkit-scrollbar {
    height: 8px;
}

#shorts-section .shorts-container::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 4px;
}

#shorts-section .shorts-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

#shorts-section .shorts-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

#shorts-section .short-video-card {
    min-width: 172px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

#shorts-section .short-thumbnail {
    position: relative;
    width: 172px;
    height: 306px;
    background: #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

#shorts-section .short-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

#shorts-section .short-video-card:hover .short-thumbnail img {
    transform: scale(1.05);
}

/* YouTube Shorts Style Grid - Vertical Portrait Layout (for listing page) */
#shorts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    padding: 0;
}

#shorts-container .short-video-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: auto;
}

#shorts-container .short-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16; /* Vertical portrait ratio like YouTube Shorts */
    background: #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    height: auto;
}

#shorts-container .short-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.short-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #0f0f0f;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.short-views {
    font-size: 13px;
    color: #606060;
}

/* Long Videos Grid - Horizontal Grid */
.long-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.long-video-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.long-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.long-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.long-video-card:hover .long-thumbnail img {
    transform: scale(1.05);
}

.video-info {
    display: flex;
    gap: 12px;
}

.video-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f9f9f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-info-icon svg {
    width: 24px;
    height: 24px;
    fill: #606060;
}

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

.video-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #0f0f0f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 14px;
    color: #606060;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #606060;
    margin-top: 4px;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* AJAX Pagination */
.ajax-load-more {
    text-align: center;
    margin-top: 32px;
    padding: 20px;
}

.load-more-btn {
    padding: 12px 24px;
    background: #0f0f0f;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: #272727;
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-videos {
    text-align: center;
    padding: 60px 20px;
    color: #606060;
}

.no-videos-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-videos h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.no-videos p {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .long-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .youtube-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .youtube-title {
        font-size: 24px;
    }

    .short-thumbnail {
        width: 140px;
        height: 248px;
    }

    .short-video-card {
        min-width: 140px;
    }

    .shorts-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        padding: 0 4px;
    }
}

@media (max-width: 600px) {
    .youtube-container {
        padding: 10px;
    }
    
    .long-videos-grid {
        grid-template-columns: 1fr;
    }
    
    .youtube-filters {
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

