/* VIDEO MODAL */
.video-modal {
    position: fixed;
    z-index: 9999;
    inset: 0;

    background: rgba(0,0,0,0.92);

    display: none;
    justify-content: center;
    align-items: center;

    padding: 20px;

    backdrop-filter: blur(8px);
}

/* VIDEO CONTAINER - 80% of screen width */
.video-content {
    position: relative;
    width: 80%;
    max-width: 80%;
    
    animation: modalFade 0.3s ease;
}

/* VIDEO - maintains aspect ratio and fits container */
.video-content video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 20px;

    box-shadow:
    0 0 40px rgba(245,197,24,0.15),
    0 0 80px rgba(58,12,163,0.2);
}

/* CLOSE BUTTON */
.close-video {
    position: absolute;
    top: -55px;
    right: 0;

    color: white;
    font-size: 50px;
    cursor: pointer;

    transition: 0.3s;
}

.close-video:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

/* MODAL ANIMATION */
@keyframes modalFade {

    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .video-content {
        width: 95%;
    }
    
    .close-video {
        top: -45px;
        font-size: 40px;
    }
}


/* MEDIA SECTION WITH FLEX GRID */
.media {
    padding: 80px 5%;
    text-align: center;
    background: #0a0f2c;
}

.media h2 {
    color: var(--gold);
    margin-bottom: 10px;
}

.media > p {
    margin-bottom: 50px;
    opacity: 0.9;
}

/* Desktop: Side by side with equal heights */
.media-grid {
    display: flex;
    gap: 50px;
    align-items: stretch; /* Makes both children equal height */
    max-width: 1400px;
    margin: 0 auto;
}

.video-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevents scrolling */
}

/* Video fills its container height */
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Makes video cover the area without distortion */
    border-radius: 20px;
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.5);
}

/* Gallery inner content */
.main-image-container {
    position: relative;
    width: 100%;
    flex-shrink: 0; /* Prevents shrinking */
}

#mainImage {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 15px;
}

/* Thumbnails container - fits without scrolling */
.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden; /* No vertical scroll */
    margin-top: 15px;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* Custom horizontal scrollbar for thumbnails */
.thumbnails::-webkit-scrollbar {
    height: 8px;
}

.thumbnails::-webkit-scrollbar-track {
    background: #1a1f3a;
    border-radius: 10px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

.thumb {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
    border: 3px solid transparent;
    flex-shrink: 0;
}

.thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumb.active {
    opacity: 1;
    border-color: var(--gold);
}

/* Navigation buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 50%;
    z-index: 10;
    transition: 0.2s;
}

.nav-btn:hover {
    background: var(--gold);
    color: black;
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

/* Tablet: Adjust gap and thumb sizes */
@media (max-width: 991px) {
    .media-grid {
        gap: 30px;
    }
    
    .thumb {
        width: 80px;
        height: 60px;
    }
    
    #mainImage {
        max-height: 350px;
    }
}

/* Mobile: Stack vertically */
@media (max-width: 767px) {
    .media-grid {
        flex-direction: column;
        gap: 40px;
    }
    
    .video-container {
        width: 100%;
    }
    
    .gallery-container {
        width: 100%;
    }
    
    .video-container video {
        max-height: 300px;
        object-fit: cover;
    }
    
    .thumb {
        width: 70px;
        height: 55px;
    }
    
    #mainImage {
        max-height: 300px;
    }
}
