/* Custom Video Manager - Frontend Styles */

.cvm-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.cvm-video-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.cvm-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.cvm-video-thumbnail {
    position: relative;
    height: 200px;
    background: #f0f0f0;
    overflow: hidden;
}

.cvm-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cvm-video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cvm-video-item:hover .cvm-video-thumbnail img {
    transform: scale(1.05);
}

.cvm-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.cvm-video-item:hover .cvm-play-button {
    opacity: 1;
}

.cvm-play-button:hover {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.cvm-play-button i {
    margin-left: 3px; /* Adjust play icon position */
}

.cvm-video-info {
    padding: 20px;
}

.cvm-video-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cvm-video-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}



/* Lightbox Styles */
.cvm-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cvm-lightbox-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 80vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.cvm-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.cvm-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#cvm-video-container {
    width: 100%;
    height: 100%;
}

#cvm-video-container iframe,
#cvm-video-container video {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading States */
.cvm-play-button.loading {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.cvm-play-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.cvm-video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.cvm-video-error i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 10px;
}

.cvm-video-error p {
    margin: 0;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cvm-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .cvm-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .cvm-video-thumbnail {
        height: 150px;
    }
    
    .cvm-video-info {
        padding: 15px;
    }
    
    .cvm-video-info h3 {
        font-size: 16px;
    }
    
    .cvm-play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .cvm-lightbox {
        padding: 10px;
    }
    
    .cvm-lightbox-content {
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .cvm-video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cvm-video-thumbnail {
        height: 200px;
    }
}

/* Mobile Grid Classes */
.cvm-video-grid.mobile-grid {
    grid-template-columns: 1fr;
}

.cvm-video-grid.tablet-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.cvm-video-grid.desktop-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}



/* Search Styles */
.cvm-search-container {
    margin-bottom: 30px;
    text-align: center;
}

.cvm-search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.cvm-search-input:focus {
    border-color: #007bff;
}

/* Pagination Styles */
.cvm-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.cvm-pagination a {
    padding: 10px 15px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.cvm-pagination a:hover,
.cvm-pagination a.active {
    background: #007bff;
    color: #fff;
}

/* Video Grid Animations */
.cvm-video-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cvm-video-item:nth-child(1) { animation-delay: 0.1s; }
.cvm-video-item:nth-child(2) { animation-delay: 0.2s; }
.cvm-video-item:nth-child(3) { animation-delay: 0.3s; }
.cvm-video-item:nth-child(4) { animation-delay: 0.4s; }
.cvm-video-item:nth-child(5) { animation-delay: 0.5s; }
.cvm-video-item:nth-child(6) { animation-delay: 0.6s; }

/* Hover Effects */
.cvm-video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cvm-video-item:hover::before {
    opacity: 1;
}

/* Video Type Indicators */
.cvm-video-type-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Accessibility */
.cvm-video-item:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.cvm-play-button:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cvm-video-item {
        border: 2px solid #000;
    }
    
    .cvm-play-button {
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cvm-video-item,
    .cvm-play-button,
    .cvm-lightbox {
        transition: none;
    }
    
    .cvm-video-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
