/**
 * Futuristic Gallery Styles
 * Modern masonry gallery with lightbox and animations
 */

/* ========================================
   Gallery Container
   ======================================== */
.futuristic-gallery {
    padding: 60px 0;
    background: linear-gradient(135deg, #585858 0%, #473b31 50%, #221e1e 100%);
    min-height: 100vh;
    width: 100%;
}

.futuristic-gallery .container {

    margin: 0 auto;
    padding: 0 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #667eea 0%, #d27d36 50%, #472b4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Category Filter
   ======================================== */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.filter-btn {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ========================================
   Masonry Grid
   ======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   Gallery Item
   ======================================== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    background: #1a1a2e;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Large items for variety */
.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), filter 0.4s ease;
    min-height: 250px;
}

.gallery-item.large img,
.gallery-item.tall img {
    min-height: 520px;
}

/* Hover Effects */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* Item Overlay Content */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.gallery-overlay .category {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* View Icon */
.gallery-item .view-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.gallery-item:hover .view-icon {
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item .view-icon svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

/* ========================================
   Video Support
   ======================================== */
.gallery-item.video-item .view-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(1); /* Always visible for videos */
}

.gallery-item.video-item:hover .view-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 0, 0, 1);
}

.gallery-item.video-item .view-icon svg {
    width: 28px;
    height: 28px;
    margin-left: 4px;
}

.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 250px;
}

.gallery-item.large video,
.gallery-item.tall video {
    min-height: 520px;
}

.gallery-item .video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

/* Lightbox Video */
.lightbox-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-content .lightbox-embed {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.lightbox-content iframe {
    width: 80vw;
    height: 45vw;
    max-width: 1200px;
    max-height: 675px;
    border: none;
    border-radius: 8px;
}

/* ========================================
   Lightbox
   ======================================== */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(20px);
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100000;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.lightbox-caption h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #ffffff;
}

.lightbox-caption span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ========================================
   Loading Animation
   ======================================== */
.gallery-item.loading {
    background: linear-gradient(90deg, #1a1a2e 0%, #2a2a4e 50%, #1a1a2e 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .gallery-header h1 {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
    }
    
    .gallery-item.large,
    .gallery-item.wide {
        grid-column: span 1;
    }
    
    .gallery-item.tall,
    .gallery-item.large {
        grid-row: span 1;
    }
    
    .gallery-item img,
    .gallery-item.large img,
    .gallery-item.tall img {
        min-height: 180px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   Filter Animation
   ======================================== */
.gallery-item.hiding {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.gallery-item.showing {
    opacity: 1;
    transform: scale(1);
    transition: all 0.4s ease;
}

/* ========================================
   No Results
   ======================================== */
.no-gallery-items {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.no-gallery-items svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-gallery-items h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}
