/* Video Grid Pro Styles */

.vgp-container {
    width: 100%;
    margin: 0 auto;
}

.vgp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px; /* Default, will be overridden by JS */
    width: 100%;
}

/* Individual Video Item */
.vgp-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 0; /* Will be set by JS */
}

.vgp-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

/* Overlay (hidden by default) */
.vgp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vgp-item:hover .vgp-overlay {
    opacity: 1;
}

.vgp-item:hover .vgp-thumbnail {
    opacity: 0.3; /* Default, will be overridden by JS */
}

/* Play Button - Fixed to prevent distortion */
.vgp-play-button {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    background: rgba(0, 255, 0, 0.9); /* Default, will be overridden by JS */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0; /* Prevent shrinking */
}

.vgp-item:hover .vgp-play-button {
    transform: scale(1.1);
}

.vgp-play-button svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    fill: #fff;
    margin-left: 3px; /* Slight offset to center the triangle visually */
    flex-shrink: 0; /* Prevent SVG distortion */
}

/* Title */
.vgp-title {
    color: #ffffff; /* Default, will be overridden by JS */
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 0 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Modal Overlay */
.vgp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vgp-modal.vgp-modal-open {
    opacity: 1;
}

/* Modal Content */
.vgp-modal-content {
    position: relative;
    width: 80%; /* Default, will be overridden by JS */
    max-width: 1200px;
    background: #000;
    border-radius: 8px; /* Will be set by JS */
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.vgp-modal.vgp-modal-open .vgp-modal-content {
    transform: scale(1);
}

/* Close Button */
.vgp-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 1000000;
}

.vgp-modal-close:hover {
    color: #ff4444;
    transform: scale(1.2);
}

/* Video Wrapper - maintains 16:9 aspect ratio */
.vgp-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.vgp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Error Message */
.vgp-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* Responsive Breakpoints */

/* Tablet - 3 columns */
@media (max-width: 1024px) {
    .vgp-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Phone - 2 columns */
@media (max-width: 768px) {
    .vgp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vgp-modal-content {
        width: 90%;
    }
    
    .vgp-title {
        font-size: 16px;
    }
    
    .vgp-play-button {
        width: 50px;
        height: 50px;
    }
    
    .vgp-play-button svg {
        width: 20px;
        height: 20px;
    }
}

/* Small Phone - 1 column */
@media (max-width: 480px) {
    .vgp-grid {
        grid-template-columns: 1fr;
    }
    
    .vgp-modal-content {
        width: 95%;
    }
    
    .vgp-title {
        font-size: 14px;
    }
    
    .vgp-modal-close {
        top: -35px;
        font-size: 35px;
    }
}

/* Accessibility - keyboard focus states */
.vgp-item:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 3px;
}

.vgp-modal-close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 5px;
}

/* Loading state */
.vgp-item.loading .vgp-thumbnail {
    opacity: 0.5;
}

/* Prevent body scroll when modal is open */
body.vgp-modal-active {
    overflow: hidden;
}
