/**
 * Related Videos from BrightVideos
 * Styling for video cards, thumbnails, and grid layout
 */

.related-videos {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.related-videos h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.related-videos-intro {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.video-card {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.play-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

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

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-link:hover .video-title {
    color: #0066cc;
}

.video-channel {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.25rem 0;
}

.video-stats {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

.view-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.related-videos-attribution {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.related-videos-attribution a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
}

.related-videos-attribution a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .related-videos {
        padding: 1rem;
    }
    
    .related-videos h2 {
        font-size: 1.25rem;
    }
    
    .related-videos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .video-info {
        padding: 0.75rem;
    }
    
    .video-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .related-videos {
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
    }
}
