/* Premium Image Gallery Styles */
.igp-premium-gallery-wrapper {
    width: 100%;
    margin: 40px auto;
    font-family: inherit;
    box-sizing: border-box;
}

.igp-gallery {
    display: block;
    column-count: auto;
    column-width: 250px; /* This allows it to auto-adjust columns based on container width */
    column-gap: 20px;
    width: 100%;
}

.igp-gallery-item {
    position: relative;
    border-radius: 16px; 
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1); 
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: #f1f1f1;
    animation: igpFadeInUp 0.6s ease-out forwards;
    opacity: 0;
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

/* Staggered load animation */
.igp-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.igp-gallery-item:nth-child(2) { animation-delay: 0.2s; }
.igp-gallery-item:nth-child(3) { animation-delay: 0.3s; }
.igp-gallery-item:nth-child(4) { animation-delay: 0.4s; }
.igp-gallery-item:nth-child(5) { animation-delay: 0.5s; }
.igp-gallery-item:nth-child(6) { animation-delay: 0.6s; }
.igp-gallery-item:nth-child(n+7) { animation-delay: 0.7s; }

@keyframes igpFadeInUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.igp-gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.igp-gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.igp-gallery-item-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 16px;
    transition: border-color 0.5s ease;
    z-index: 3;
    pointer-events: none;
}

.igp-gallery-item:hover .igp-gallery-item-inner::after {
    border-color: rgba(255, 255, 255, 0.4);
}

.igp-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.igp-gallery-item:hover img {
    transform: scale(1.15);
}

.igp-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 40%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    color: #fff;
    z-index: 2;
}

.igp-gallery-item:hover .igp-hover-overlay {
    opacity: 1;
}

.igp-hover-overlay svg {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    padding: 16px;
    width: 64px;
    height: 64px;
    box-sizing: border-box;
    transform: scale(0.5) translateY(40px) rotate(-15deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.igp-gallery-item:hover .igp-hover-overlay svg {
    transform: scale(1) translateY(0) rotate(0deg);
    opacity: 1;
}

/* Lightbox Styles */
.igp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.igp-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85); /* Darker overlay for better contrast */
    backdrop-filter: blur(10px); /* Stronger glassmorphism effect */
}

.igp-lightbox-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.igp-lightbox-img-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.igp-lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    object-fit: contain;
}

.igp-lightbox-img.igp-img-loaded {
    opacity: 1;
    transform: scale(1);
}

.igp-lightbox-close,
.igp-lightbox-prev,
.igp-lightbox-next {
    position: absolute;
    color: #fff;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    backdrop-filter: blur(4px);
}

.igp-lightbox-close:hover,
.igp-lightbox-prev:hover,
.igp-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: scale(1.1);
}

.igp-lightbox-close {
    top: -20px;
    right: -20px;
}

.igp-lightbox-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.igp-lightbox-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.igp-lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.igp-lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .igp-gallery {
        column-width: 160px; /* Slightly adjusted for better mobile fit */
        column-gap: 15px;
    }
    .igp-gallery-item {
        border-radius: 12px;
        margin-bottom: 15px;
    }
    .igp-gallery-item-inner, .igp-gallery-item-inner::after {
        border-radius: 12px;
    }
    .igp-lightbox-prev {
        left: 10px;
        background: rgba(0,0,0,0.5);
    }
    .igp-lightbox-next {
        right: 10px;
        background: rgba(0,0,0,0.5);
    }
    .igp-lightbox-close {
        top: -40px;
        right: 0;
        background: rgba(0,0,0,0.5);
    }
    .igp-lightbox-prev:hover,
    .igp-lightbox-next:hover,
    .igp-lightbox-close:hover {
        background: rgba(255,255,255,0.9);
    }
}
