/* Videos Page Specific Styles */
#video-gallery {
    padding: 4rem 2rem;
    text-align: center;
    position: relative; /* Ensure it's above the video background */
    z-index: 2;
}

#video-gallery h1 {
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 2rem; /* Adjusted margin */
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.video-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Search Bar */
.search-container {
    flex-grow: 1; /* Allows the search bar to take up available space */
    display: flex;
    justify-content: flex-end;
}

#video-search {
    width: 100%;
    max-width: 450px;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: background-color 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#video-search:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px; /* Pill-shaped buttons */
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.filter-btn:hover {
    background-color: rgba(255, 193, 7, 0.5);
    color: #000;
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: #ffc107;
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.7);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.video-item {
    background-color: rgba(17, 17, 17, 0.7); /* Dark, semi-transparent background */
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 6px 6px rgba(0, 0, 0, 0.23);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block; /* Ensure it is visible by default */
}

.video-item.hidden {
    display: none; /* Class to hide videos */
}

.video-item:hover {
    transform: scale(1.04);
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.6), 0 0 15px rgba(255, 255, 255, 0.4);
}

.video-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
    object-fit: cover;
}

.video-item .title {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: left;
    transition: background 0.3s ease;
}

/* Make title slightly more prominent on hover */
.video-item:hover .title {
     background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 100%);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .video-controls {
        flex-direction: column-reverse; /* Puts search on top on mobile */
        align-items: center;
    }
    
    .search-container {
        margin-bottom: 1.5rem;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    #video-gallery {
        padding: 2rem 1rem;
    }

    #video-gallery h1 {
        font-size: 2.5rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
}

/* Video Player Modal (Overlay) */
.player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.player-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Allows clicking through when hidden */
}

.player-container {
    position: relative;
    width: 90%;
    max-width: 1100px;
    background-color: #000;
    box-shadow: 0 0 50px rgba(255, 193, 7, 0.5);
    border-radius: 10px;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}

.close-btn:hover {
    color: #ffc107;
    transform: scale(1.1);
}