/* Custom Video Slider - Frontend Styles */

.cvs-video-gallery {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cvs-video-item {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cvs-video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.cvs-video-item video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

.cvs-video-item .cvs-video-embed {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.cvs-video-item .cvs-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.cvs-video-controls {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cvs-video-controls button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.cvs-video-controls button:hover {
    background: #005a87;
}

.cvs-video-controls button:active {
    transform: translateY(1px);
}

.cvs-video-controls .cvs-play-pause {
    background: #28a745;
}

.cvs-video-controls .cvs-play-pause:hover {
    background: #218838;
}

.cvs-video-controls .cvs-fullscreen {
    background: #6c757d;
}

.cvs-video-controls .cvs-fullscreen:hover {
    background: #5a6268;
}

.cvs-video-info {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.cvs-video-info strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.cvs-video-info .cvs-duration {
    color: #666;
    font-size: 14px;
}

/* Video Thumbnails */
.cvs-video-thumbnails {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cvs-video-thumbnails h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.cvs-video-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.cvs-video-thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cvs-video-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.cvs-video-thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.cvs-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.cvs-video-thumbnail:hover .cvs-play-icon {
    background: rgba(0,0,0,0.9);
}

.cvs-video-thumbnail .cvs-thumbnail-title {
    padding: 8px;
    font-size: 12px;
    color: #333;
    text-align: center;
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lightbox */
.cvs-video-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.cvs-lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.cvs-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.cvs-lightbox-close:hover {
    background: rgba(255,255,255,0.1);
}

.cvs-lightbox-video {
    width: 100%;
    height: auto;
}

.cvs-lightbox-video video {
    width: 100%;
    height: auto;
    display: block;
}

.cvs-lightbox-video iframe {
    width: 100%;
    height: auto;
    min-height: 400px;
}

/* Progress Bar */
.cvs-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.cvs-progress-bar {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.1s ease;
}

/* Volume Control */
.cvs-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.cvs-volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.cvs-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
}

.cvs-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.cvs-mute {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.cvs-mute:hover {
    background: rgba(0,0,0,0.1);
}

/* Quality Selector */
.cvs-quality-selector {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

/* Loading States */
.cvs-loading {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.cvs-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.cvs-error {
    padding: 20px;
    text-align: center;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.cvs-error-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cvs-video-gallery {
        margin: 15px 0;
        padding: 15px;
    }
    
    .cvs-video-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .cvs-video-controls button {
        width: 100%;
    }
    
    .cvs-volume-control {
        margin-left: 0;
        justify-content: center;
    }
    
    .cvs-video-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .cvs-video-thumbnail img {
        height: 60px;
    }
    
    .cvs-lightbox-content {
        max-width: 98%;
        max-height: 98%;
    }
    
    .cvs-lightbox-close {
        top: -40px;
        right: 10px;
        font-size: 28px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .cvs-video-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .cvs-video-thumbnail img {
        height: 50px;
    }
    
    .cvs-play-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Accessibility */
.cvs-video-item:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.cvs-video-controls button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cvs-video-item {
        border: 2px solid #000;
    }
    
    .cvs-video-controls button {
        border: 2px solid #000;
    }
    
    .cvs-play-icon {
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cvs-video-item,
    .cvs-video-thumbnail,
    .cvs-video-controls button {
        transition: none;
    }
    
    .cvs-progress-bar {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .cvs-video-gallery,
    .cvs-video-thumbnails,
    .cvs-video-controls {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cvs-video-gallery {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .cvs-video-item {
        background: #1a202c;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .cvs-video-controls {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .cvs-video-info {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .cvs-video-info strong {
        color: #e2e8f0;
    }
    
    .cvs-video-info .cvs-duration {
        color: #a0aec0;
    }
    
    .cvs-video-thumbnails {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .cvs-video-thumbnails h4 {
        color: #e2e8f0;
    }
    
    .cvs-video-thumbnail {
        background: #1a202c;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .cvs-video-thumbnail .cvs-thumbnail-title {
        background: #1a202c;
        color: #e2e8f0;
    }
}
