/* Video Gallery Styles */
.video-gallery-wrapper {
    max-width: 1200px;
    margin: 40px auto 0 auto; /* top right bottom left */
    padding: 20px;
}

.video-gallery-container {
    width: 100%;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    color: #004080;
    margin-bottom: 15px;
    font-size: 2.5em;
}

.gallery-description {
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Video Gallery Grid */
.video-gallery-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(var(--video-columns, 3), 1fr);
    margin-bottom: 40px;
}

.video-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
    border: 2px solid #007bff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    aspect-ratio: 16/9;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-color: #0056b3;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder i {
    font-size: 60px;
    color: white;
    opacity: 0.8;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 2;
}

.play-button i {
    color: #e74c3c;
    font-size: 28px;
    margin-left: 5px;
}

.video-item:hover .play-button {
    background: #e74c3c;
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.video-item:hover .play-button i {
    color: white;
}

.video-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-item:hover .video-title-overlay {
    opacity: 1;
}

.video-description {
    padding: 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: none; /* Hidden by default, shown on hover if needed */
}

/* Video Lightbox Modal */
.video-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
    box-sizing: border-box;
}

.video-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.video-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 100;
}

.video-lightbox-close:hover {
    background: rgba(255, 55, 66, 0.9);
    transform: scale(1.1);
}

.video-player-container {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    background: #000;
}

.video-player-container iframe,
.video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-lightbox-caption {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
}

.video-lightbox-caption strong {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
}

/* No Videos Message */
.no-videos-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-videos-message p {
    margin-bottom: 15px;
}

.btn-add-videos {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-add-videos:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    color: white;
    text-decoration: none;
}

/* Loading indicator for video */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .video-gallery-wrapper {
        max-width: 100%;
        padding: 30px 15px;
    }

    .video-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .video-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .video-gallery-grid {
        grid-template-columns: 1fr;
    }

    .video-lightbox-content {
        width: 95%;
    }

    .play-button {
        width: 60px;
        height: 60px;
    }

    .play-button i {
        font-size: 24px;
    }

    .gallery-title {
        font-size: 1.8em;
    }
}