/* Base grid styling */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 20px;
    grid-auto-flow: dense;
}

/* Styling for individual video cards */
.video-grid-item {
    position: relative;
    background-color: #FFFFFF;
    /* Slightly darker light gray for contrast */
    padding: 8px;
    overflow: hidden;
    border: 1px solid #f0eaea;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect for video cards */
.video-grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Video thumbnail styling */
.video-grid-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    object-fit: cover;
    /* Keeps thumbnails cropped appropriately */
}

/* Video title styling */
.video-grid-item .video-title {
    margin-top: 10px;
    font-size: 14px;
    color: #333333;
    font-weight: bold;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hover effect for video title */
.video-grid-item .video-title:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Video description overlay */
.video-grid-item .video-description {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    /* Semi-transparent background */
    color: rgba(255, 255, 255, 0.9);
    /* Semi-transparent text */
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Show description on hover */
.video-grid-item:hover .video-description {
    opacity: 1;
}

/* Responsive layout adjustments */
@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1201px) and (max-width: 2000px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 2001px) {
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
/* Modal background */
.video-modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark transparent background */
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* Modal content container */
.video-modal-content {
    position: relative;
    width: 80%;
    max-width: 800px;
    height: 45%; /* Aspect ratio for 16:9 videos */
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.close-btn:hover {
    transform: scale(1.2);
}

/* Embedded YouTube video */
#video-player {
    width: 100%;
    height: 100%;
    border: none;
}

/* Disable background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

