/* Video Card Styles */
.video-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Thumbnail Container */
.thumb-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-card:hover .thumb-wrap img {
    transform: scale(1.05);
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay .icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.video-card:hover .play-overlay .icon {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Duration Badge */
.duration-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Card Body */
.card-body {
    padding: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-title a {
    color: #333;
    text-decoration: none;
}

.card-title a:hover {
    color: #007bff;
}

/* Line Clamp for Title */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em; /* Ensure consistent height for 2 lines */
}

/* Meta Row */
.card-meta {
    margin-top: auto;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-name {
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.meta-separator {
    color: #adb5bd;
    font-weight: bold;
}

.views-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.views-count i {
    font-size: 0.75rem;
}

.publish-time {
    white-space: nowrap;
    color: #6c757d;
}

/* Section Styles */
.video-section {
    margin-bottom: 3rem;
}

.section-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.rss-link {
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.rss-link:hover {
    color: #007bff !important;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    .meta-row {
        font-size: 0.8rem;
        gap: 0.25rem;
    }
    
    .author-name {
        max-width: 80px;
    }
    
    .play-overlay .icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .video-section {
        margin-bottom: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .rss-link {
        align-self: flex-end;
    }
}

/* Grid Spacing */
.row-cols-1 .col {
    margin-bottom: 1rem;
}

.row-cols-sm-2 .col {
    margin-bottom: 1.5rem;
}

.row-cols-lg-3 .col {
    margin-bottom: 2rem;
}

/* Empty State */
.text-center.text-muted {
    padding: 3rem 1rem;
}

.text-center.text-muted i {
    color: #dee2e6;
}

/* Accessibility */
.video-card:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.card-title a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Loading State */
.thumb-wrap img[loading="lazy"] {
    background: #f8f9fa;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .video-card {
        border: 1px solid #000;
    }
    
    .play-overlay .icon {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #fff;
    }
    
    .duration-badge {
        background: #000;
        border: 1px solid #fff;
    }
}
