/* --- UNIFIED MEDIA GALLERY (MIXED) --- */

/* Filters */
.gallery-filters {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s all ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(26, 72, 142, 0.3);
}

/* Unified Grid Layout & Legacy Support */
.media-grid, .pro-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* Media Card (Common) & Legacy */
.media-card, .gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #fff;
    aspect-ratio: 4/3; /* Consistent aspect ratio */
}

.media-card:hover, .gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    z-index: 2;
}

/* Media Wrapper */
.media-wrapper, .g-img-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.media-placeholder, .g-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: 0.6s transform;
}

/* Hover Zoom */
.media-card:hover .media-placeholder, 
.gallery-card:hover .g-placeholder {
    transform: scale(1.1);
}

/* Overlay */
.media-overlay, .g-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: 0.3s opacity;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.media-card:hover .media-overlay,
.gallery-card:hover .g-overlay {
    opacity: 1;
}

/* Type Badge (Video/Photo) */
.media-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
}

.media-type-badge i {
    font-size: 0.8rem;
    color: var(--accent);
}

/* Play Icon (For Videos) */
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    border: 2px solid rgba(255,255,255,0.5);
    transition: 0.3s all;
    opacity: 0.8;
}

.media-card:hover .play-icon-overlay {
    transform: translate(-50%, -50%) scale(1);
    background: var(--accent);
    border-color: var(--accent);
    opacity: 1;
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

/* Info Text */
.media-info, .g-info {
    transform: translateY(20px);
    transition: 0.3s transform;
}

.media-card:hover .media-info,
.gallery-card:hover .g-info {
    transform: translateY(0);
}

.media-cat, .g-cat {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.media-info h4, .g-info h4 {
    color: white;
    font-size: 1.1rem;
    margin: 0;
    font-family: var(--font-heading);
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.g-info i {
    color: white;
    margin-top: 10px;
    opacity: 0.8;
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Legacy Modal Content (Index.html) */
#gallery-modal .modal-content {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#gallery-modal #modal-img {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    display: block;
    width: 100%;
}

.modal-content-wrapper {
    position: relative;
    width: 100%;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-media-container {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.modal-media-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    width: auto;
    height: auto;
}

.modal-media-container iframe {
    width: 100%;
    height: 56.25vw; /* 16:9 Aspect Ratio */
    max-height: 80vh;
    max-width: 142vh; /* (80vh * 16 / 9) */
    border: none;
}

.modal-caption {
    margin-top: 15px;
    text-align: center;
    color: white;
    width: 100%;
}

.modal-caption h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.modal-caption .meta-info {
    font-size: 0.9rem;
    color: #aaa;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-caption .meta-tag {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoomIn {
    from {transform:scale(0.8); opacity:0}
    to {transform:scale(1); opacity:1}
}

/* --- NAVIGATION ARROWS --- */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 10001; /* Above everything */
    background-color: rgba(0, 0, 0, 0.3); /* Subtle background */
    text-decoration: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Lighter on hover */
    color: var(--accent);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 992px) {
    .pro-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 250px;
    }
}

@media (max-width: 768px) {
    .pro-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    
    .prev, .next {
        padding: 10px;
        font-size: 24px;
        background-color: rgba(0, 0, 0, 0.5);
    }
}

@media (max-width: 576px) {
    .pro-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
}
