/* Video Category Grid Styles */
.vcg-wrapper {
    width: 100%;
}

.vcg-grid {
    display: grid;
    gap: 12px;
    width: 100%;
}

.vcg-item {
    position: relative;
    display: block;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    border-radius: 10px;
}

.vcg-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.vcg-thumb {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 0.35s ease, transform 0.45s ease;
    z-index: 1;
}

.vcg-item video.vcg-self-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 2;
}

.vcg-iframe-wrap {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.35s ease;
    overflow: hidden;
    background: #000;
}

.vcg-iframe-wrap iframe.vcg-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: none;
}

.vcg-item:hover video.vcg-self-video,
.vcg-item:hover .vcg-iframe-wrap {
    opacity: 1;
}

.vcg-item:hover .vcg-thumb {
    opacity: 0;
}

.vcg-item.vcg-zoom:hover video.vcg-self-video,
.vcg-item.vcg-zoom:hover .vcg-thumb {
    transform: scale(1.05);
}

/* Hide native controls on hover */
.vcg-item video.vcg-self-video::-webkit-media-controls,
.vcg-item video.vcg-self-video::-webkit-media-controls-enclosure {
    display: none !important;
}

.vcg-preview-hitarea {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    background: transparent;
}

/* Play Icon */
.vcg-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 10px;
    border-radius: 50%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.vcg-play-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    display: block;
}

.vcg-item:hover .vcg-play-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Overlay */
.vcg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.vcg-item:hover .vcg-overlay {
    opacity: 1;
}

/* Title */
.vcg-title-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.65);
    z-index: 7;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.vcg-item:hover .vcg-title-wrap {
    opacity: 1;
    transform: translateY(0);
}

.vcg-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pagination */
.vcg-pagination {
    margin-top: 30px;
    text-align: center;
}

.vcg-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.vcg-pagination .page-numbers:hover,
.vcg-pagination .page-numbers.current {
    background: #007bff;
    color: #fff;
}

/* Placeholder */
.vcg-placeholder {
    background: #f0f2f5;
    border: 2px dashed #b0b8c1;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .vcg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .vcg-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   POPUP MODAL STYLES - FIXED VERSION
   ============================================ */
.vcg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
}

.vcg-modal.active {
    display: flex !important;
}

.vcg-modal-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vcg-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vcg-modal-close:hover {
    background: #ff4444;
    color: #fff;
    transform: scale(1.1);
}

.vcg-modal-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
}

.vcg-modal-video-wrap iframe,
.vcg-modal-video-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive popup */
@media (max-width: 768px) {
    .vcg-modal-content {
        width: 95%;
    }
    
    .vcg-modal-close {
        top: -45px;
        right: -10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

body.vcg-modal-open {
    overflow: hidden;
}