/**
 * PoznetYTMovie - Frontend CSS
 *
 * @author    Pozycjoner.net
 * @copyright 2024 Pozycjoner.net
 * @license   Commercial license
 */

/* YouTube Tab Styling */
.nav-tabs .youtube-tab .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-tabs .youtube-tab .nav-link .fab.fa-youtube {
    color: #dc3545;
    font-size: 16px;
}

.nav-tabs .youtube-tab .nav-link:hover {
    color: #dc3545;
}

.nav-tabs .youtube-tab .nav-link.active {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

.youtube-video-count {
    background: #dc3545;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 4px;
}

/* YouTube Videos Container */
.youtube-videos-container {
    padding: 30px 0;
}

.videos-header {
    text-align: center;
    margin-bottom: 30px;
}

.videos-title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.videos-title::before {
    content: "\f167";
    font-family: "Font Awesome 5 Brands";
    color: #dc3545;
    font-size: 28px;
}

.videos-description {
    color: #6c757d;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Video Card */
.video-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

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

/* Video Thumbnail Container */
.video-thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000000;
}

.video-play-btn {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    position: relative;
}

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

.video-play-btn:hover .video-thumbnail {
    transform: scale(1.05);
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
}

.video-play-btn:hover .play-overlay {
    background: rgba(220, 53, 69, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    color: white;
    font-size: 24px;
    margin-left: 4px;
}

/* Video Info */
.video-info {
    padding: 20px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Video Meta */
.video-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #6c757d;
}

.video-duration {
    display: flex;
    align-items: center;
    gap: 5px;
}

.youtube-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #dc3545;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.youtube-link:hover {
    color: #bd2130;
    text-decoration: none;
}

/* Loading State */
.youtube-video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 18px;
}

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

/* Error State */
.youtube-video-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #721c24;
}

.youtube-video-error::before {
    content: "\f071";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
    color: #dc3545;
}

/* Empty State */
.youtube-videos-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.youtube-videos-empty::before {
    content: "\f167";
    font-family: "Font Awesome 5 Brands";
    font-size: 48px;
    display: block;
    margin-bottom: 20px;
    color: #dee2e6;
}

.youtube-videos-empty h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #495057;
}

.youtube-videos-empty p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* Iframe Container */
.youtube-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.youtube-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .videos-header {
        padding: 0 15px;
    }
    
    .videos-title {
        font-size: 20px;
    }
    
    .videos-description {
        font-size: 14px;
    }
    
    .video-info {
        padding: 15px;
    }
    
    .video-title {
        font-size: 15px;
    }
    
    .play-overlay {
        width: 50px;
        height: 50px;
    }
    
    .play-icon {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .youtube-videos-container {
        padding: 20px 0;
    }
    
    .videos-grid {
        gap: 15px;
    }
    
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Touch-Friendly Interactions */
@media (hover: none) {
    .video-play-btn:active .video-thumbnail {
        transform: scale(0.98);
    }
    
    .video-play-btn:active .play-overlay {
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* Accessibility */
.video-play-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.youtube-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print Styles */
@media print {
    .youtube-videos-container {
        display: none;
    }
}