/* Library Page Styles */

.library-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    min-height: 400px; /* Ensure container has height */
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    min-height: 200px; /* Ensure grid has height */
}

/* Debug: Make sure video cards are visible */
.video-card {
    background: white;
    border-radius: var(--border-radius-lg, 12px);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 300px; /* Ensure cards have height */
}

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

.video-card-thumbnail {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
    overflow: hidden;
    background: #f5f5f5;
}

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

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

.video-card-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(7, 95, 116, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card:hover .video-card-play-button {
    opacity: 1;
    background: rgba(7, 95, 116, 1);
}

.video-card-content {
    padding: 1.5rem;
}

.video-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.video-card-description {
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(7, 95, 116, 0.2);
    border-top: 4px solid var(--primary, #075f74);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.library-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted, #999);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .library-container {
        padding: 1rem;
    }
    
    .library-title {
        font-size: 2rem;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .category-filters {
        gap: 0.75rem;
    }
    
    .category-filter {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .library-container {
        padding: 0.75rem;
    }
    
    .library-title {
        font-size: 1.75rem;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .video-card-thumbnail {
        height: 180px;
    }
    
    .video-card-content {
        padding: 1rem;
    }
    
    .video-card-title {
        font-size: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .video-card,
    .video-card-thumbnail img,
    .video-card-play-button {
        transition: none;
    }
    
    .video-card:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .video-card {
        border: 2px solid var(--text-primary, #333);
    }
    
    .category-filter {
        border: 2px solid var(--text-primary, #333);
    }
}
