/**
 * DeepTube Component Styles
 * Styles for dynamically generated components
 */

/* ==========================================================================
   Card Animations
   ========================================================================== */

.card-fade-in {
    transition: opacity 0.3s ease, border-color 0.2s ease;
}

.card-image-fade {
    transition: opacity 0.3s ease;
}

/* Staggered animation delays for card grids */
.card-delay-0 { transition-delay: 0ms; }
.card-delay-1 { transition-delay: 30ms; }
.card-delay-2 { transition-delay: 60ms; }
.card-delay-3 { transition-delay: 90ms; }
.card-delay-4 { transition-delay: 120ms; }
.card-delay-5 { transition-delay: 150ms; }
.card-delay-6 { transition-delay: 180ms; }
.card-delay-7 { transition-delay: 210ms; }
.card-delay-8 { transition-delay: 240ms; }
.card-delay-9 { transition-delay: 270ms; }
.card-delay-10 { transition-delay: 300ms; }
.card-delay-11 { transition-delay: 330ms; }
.card-delay-12 { transition-delay: 360ms; }
.card-delay-13 { transition-delay: 390ms; }
.card-delay-14 { transition-delay: 420ms; }
.card-delay-15 { transition-delay: 450ms; }
.card-delay-16 { transition-delay: 480ms; }
.card-delay-17 { transition-delay: 510ms; }
.card-delay-18 { transition-delay: 540ms; }
.card-delay-19 { transition-delay: 570ms; }

/* ==========================================================================
   Channel Card Background
   ========================================================================== */

.channel-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}

/* ==========================================================================
   Video Card Thumbnail
   ========================================================================== */

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail.loaded {
    opacity: 1;
}

/* ==========================================================================
   Duration Badge
   ========================================================================== */

.duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

/* ==========================================================================
   Play Overlay
   ========================================================================== */

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.play-button {
    width: 3rem;
    height: 3rem;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.video-card:hover .play-button,
.group:hover .play-button {
    transform: scale(1);
}

/* ==========================================================================
   Stats Display
   ========================================================================== */

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 50;
}

.modal-content {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 51;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Loading Skeleton
   ========================================================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   Filter & Sort Components
   ========================================================================== */

.filter-dropdown {
    position: relative;
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 20;
    overflow: hidden;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.filter-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-option.active {
    color: var(--accent);
}

/* ==========================================================================
   Chevron Rotation
   ========================================================================== */

.chevron-rotate {
    transition: transform 0.2s ease;
}

.chevron-rotate.open {
    transform: rotate(180deg);
}
