/**
 * PVG Frontend CSS
 * Modern, responsive video gallery styles
 */

.pvg-video-gallery {
    display: none;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pvg-gallery-container {
    position: relative;
    width: 100%;
}

.pvg-main-display {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.pvg-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.pvg-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pvg-image-display {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pvg-image-display img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pvg-image-display img:hover {
    transform: scale(1.02);
}

/* Video Player Section */
.pvg-video-player-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

/* Video thumbnails */
.pvg-video-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
    margin-top: 16px;
}

.pvg-video-thumbnails::-webkit-scrollbar {
    display: none;
}

.pvg-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.pvg-thumbnail:hover {
    transform: scale(1.05);
    border-color: #94be58;
}

.pvg-thumbnail.active {
    border-color: #94be58;
    box-shadow: 0 0 0 2px rgba(148, 190, 88, 0.2);
}

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

.pvg-thumbnail img:hover {
    transform: scale(1.02);
}

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

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

.pvg-play-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    transition: all 0.2s ease;
}

.pvg-play-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.pvg-video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.pvg-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 16px 8px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Lightbox */
.pvg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.pvg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.pvg-lightbox-content img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

.pvg-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.pvg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pvg-main-display {
        aspect-ratio: 4/3;
    }
    
    .pvg-thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .pvg-play-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pvg-main-display {
        aspect-ratio: 1/1;
    }
    
    .pvg-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .pvg-play-button {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .pvg-video-title {
        font-size: 10px;
        padding: 12px 6px 6px;
    }
}

/* Accessibility */
.pvg-thumbnail:focus,
.pvg-play-button:focus,
.pvg-lightbox-close:focus {
    outline: 2px solid #94be58;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .pvg-thumbnail.active {
        border-color: #000;
    }
    
    .pvg-play-button {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pvg-thumbnail,
    .pvg-play-button,
    .pvg-lightbox,
    .pvg-image-display img {
        transition: none;
        animation: none;
    }
}

/* Loading state */
.pvg-thumbnail.loading {
    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; }
}

/* Print styles */
@media print {
    .pvg-lightbox,
    .pvg-play-overlay {
        display: none !important;
    }
    
    .pvg-thumbnail {
        page-break-inside: avoid;
    }
} 