/* ========================================
   Church Videos Page - YouTube-Style UI
   ======================================== */

/* Filter and Sort Bar */
.videos-filters {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.category-filters .btn {
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-filters .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sort-dropdown {
    min-width: 180px;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    border-color: #dee2e6;
}

.sort-dropdown:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

/* Video Card Container */
.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.video-card:focus {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
}

/* Thumbnail Container */
.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Duration Badge (bottom-right) */
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    letter-spacing: 0.5px;
    font-family: 'Roboto Mono', monospace;
}

/* Play Button Overlay (center) */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(233, 30, 99, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 2;
}

.video-card:hover .play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-overlay i {
    color: #fff;
    font-size: 24px;
    margin-left: 4px; /* Optical alignment for play icon */
}

/* Video Info Section */
.video-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 44px; /* 2 lines * 22px line-height */
}

.video-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6c757d;
    margin-top: auto;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-meta i {
    color: #e91e63;
    font-size: 14px;
}

/* Inline Video Player Section */
.video-player-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 50px 0;
    margin-bottom: 40px;
    border-bottom: 3px solid #e91e63;
}

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Current Video Info */
.current-video-info {
    padding: 24px 0;
    border-bottom: 1px solid #dee2e6;
}

.current-video-info h4 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

.current-video-info .video-stats {
    display: flex;
    gap: 24px;
    margin: 12px 0;
    font-size: 14px;
    color: #6c757d;
}

.current-video-info .video-stats i {
    color: #e91e63;
    margin-right: 6px;
}

.current-video-info p {
    font-size: 15px;
    line-height: 1.6;
    color: #495057;
}

/* Related Videos Sidebar */
.related-videos {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.related-videos h5 {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e91e63;
}

/* Empty State */
.empty-state {
    padding: 80px 20px;
}

.empty-state i {
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* CTA Section */
.cta-section {
    border-top: 1px solid #dee2e6;
}

.cta-section h3 {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
}

.cta-section .btn-primary {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
}

/* Loading State */
.video-card.loading .video-thumbnail {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Responsive Design */
@media (max-width: 991px) {
    .video-player-section {
        padding: 40px 0;
    }

    .current-video-info h4 {
        font-size: 20px;
    }

    .related-videos {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .video-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .video-meta {
        flex-direction: column;
        gap: 4px;
    }

    .play-overlay {
        width: 50px;
        height: 50px;
    }

    .play-overlay i {
        font-size: 20px;
    }

    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .category-filters .btn {
        white-space: nowrap;
    }

    .sort-dropdown {
        width: 100%;
    }

    .cta-section h3 {
        font-size: 20px;
    }

    .cta-section .btn-primary {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .video-card {
        margin-bottom: 20px;
    }

    .video-player-section {
        padding: 30px 0;
    }

    .current-video-info {
        padding: 16px 0;
    }

    .current-video-info h4 {
        font-size: 18px;
    }

    .empty-state {
        padding: 60px 20px;
    }

    .empty-state h3 {
        font-size: 22px;
    }

    .empty-state i {
        font-size: 3rem !important;
    }
}

/* Print Styles */
@media print {
    .videos-filters,
    .play-overlay,
    .cta-section {
        display: none;
    }

    .video-card {
        break-inside: avoid;
    }
}

/* Accessibility */
.video-card:focus-visible {
    outline: 3px solid #e91e63;
    outline-offset: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .video-card {
        border: 2px solid #000;
    }

    .play-overlay {
        background: #000;
        border: 2px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .video-card,
    .video-thumbnail img,
    .play-overlay,
    .category-filters .btn {
        transition: none;
    }

    .video-card:hover {
        transform: none;
    }
}
