/* ============================================
   ADVANCED GALLERY STYLES
   Elegant gallery with lightbox, hover effects,
   and masonry-style layout
   ============================================ */

/* Gallery Container */
.elegant-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4) 0;
}

.elegant-gallery--large {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.elegant-gallery--compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-3);
}

/* Gallery Item */
.elegant-gallery__item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    cursor: pointer;
    aspect-ratio: 3/4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.elegant-gallery__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.elegant-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.elegant-gallery__item:hover img {
    transform: scale(1.08);
}

/* Overlay Effect */
.elegant-gallery__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            transparent 100%);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    backdrop-filter: blur(2px);
}

.elegant-gallery__item:hover .elegant-gallery__overlay {
    opacity: 1;
}

.elegant-gallery__caption {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 500;
    letter-spacing: 0.05em;
    transform: translateY(20px);
    transition: transform 0.4s ease;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
}

.elegant-gallery__item:hover .elegant-gallery__caption {
    transform: translateY(0);
}

/* View Icon */
/* Custom Plus Icon using CSS */
.elegant-gallery__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-size: 0;
    /* Hide emoji text */
    color: transparent;
    /* Hide emoji text */
}

.elegant-gallery__icon::before,
.elegant-gallery__icon::after {
    content: '';
    position: absolute;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

/* Vertical line */
.elegant-gallery__icon::before {
    width: 1px;
    height: 16px;
}

/* Horizontal line */
.elegant-gallery__icon::after {
    width: 16px;
    height: 1px;
}

.elegant-gallery__item:hover .elegant-gallery__icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

.elegant-gallery__item:hover .elegant-gallery__icon::before,
.elegant-gallery__item:hover .elegant-gallery__icon::after {
    background-color: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* ============================================
   LIGHTBOX STYLES
   ============================================ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.lightbox.active .lightbox__image {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

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

.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%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox__nav--prev {
    left: 20px;
}

.lightbox__nav--next {
    right: 20px;
}

.lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-family-body);
    font-size: var(--text-sm);
}

/* ============================================
   GALLERY FILTERS
   ============================================ */

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin-bottom: var(--space-6);
}

.gallery-filter {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: var(--font-family-body);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-filter:hover,
.gallery-filter.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-inverse);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .elegant-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .elegant-gallery--large {
        grid-template-columns: repeat(2, 1fr);
    }

    .lightbox__nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox__nav--prev {
        left: 10px;
    }

    .lightbox__nav--next {
        right: 10px;
    }

    .lightbox__close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .elegant-gallery--compact {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2);
    }

    .elegant-gallery__overlay {
        opacity: 1;
        background: linear-gradient(to top,
                rgba(26, 26, 26, 0.6) 0%,
                transparent 50%);
    }
}