/* IpGallery Style Sheet */
:root {
    --ip-primary-color: #007bff;
    --ip-primary-hover: #0056b3;
    --ip-text-light: #ffffff;
    --ip-bg-dark-alpha: rgba(15, 15, 20, 0.85);
    --ip-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --ip-card-radius: 12px;
}

.ip-gallery-container {
    width: 100%;
    margin: 20px 0;
    font-family: inherit;
}

/* Category Tabs */
.ip-gallery-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    width: 100%;
}
.ip-gallery-tabs {
    display: flex;
    list-style: none;
    padding: 6px;
    margin: 0;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 30px;
    flex-wrap: wrap;
    justify-content: center;
}
.ip-gallery-tab {
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.ip-gallery-tab:hover {
    color: var(--ip-primary-color);
}
.ip-gallery-tab.active {
    background: #ffffff;
    color: var(--ip-primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Grid Layout */
.ip-gallery-grid {
    transition: all 0.3s ease;
}
.ip-gallery-grid.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Masonry Layout */
.ip-gallery-grid.layout-masonry {
    column-count: 4;
    column-gap: 24px;
}
.ip-gallery-grid.layout-masonry .ip-gallery-item {
    break-inside: avoid;
    margin-bottom: 24px;
    display: block;
}

/* Justified Layout */
.ip-gallery-grid.layout-justified {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.ip-gallery-grid.layout-justified .ip-gallery-item {
    flex-grow: 1;
    min-width: 200px;
    height: 250px;
}
.ip-gallery-grid.layout-justified .ip-gallery-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* Carousel Layout */
.ip-gallery-grid.layout-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 20px;
    padding-bottom: 15px;
}
.ip-gallery-grid.layout-carousel .ip-gallery-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}
.ip-gallery-grid.layout-carousel::-webkit-scrollbar {
    height: 6px;
}
.ip-gallery-grid.layout-carousel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Gallery Item Card */
.ip-gallery-item {
    position: relative;
    border-radius: var(--ip-card-radius);
    overflow: hidden;
    background: #fdfdfd;
    box-shadow: var(--ip-card-shadow);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}
.ip-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}
.ip-gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
}
.ip-gallery-img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
    object-fit: cover;
}
.ip-gallery-grid.layout-grid .ip-gallery-img {
    height: 230px;
}
.ip-gallery-item:hover .ip-gallery-img {
    transform: scale(1.06);
}

/* Overlay & Caption */
.ip-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 80%);
    backdrop-filter: blur(1px);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: opacity 0.4s ease;
    box-sizing: border-box;
}
.ip-gallery-item:hover .ip-gallery-overlay {
    opacity: 1;
}
.ip-gallery-info {
    transform: translateY(15px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.ip-gallery-item:hover .ip-gallery-info {
    transform: translateY(0);
}
.ip-gallery-title {
    color: var(--ip-text-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    display: block;
    line-height: 1.3;
}
.ip-gallery-cat {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 400;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lightbox styles */
.ip-gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ip-bg-dark-alpha);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ip-gallery-lightbox.active {
    opacity: 1;
    display: flex;
}
.ip-lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
    z-index: 100001;
}
.ip-lightbox-close:hover {
    color: #fff;
}
.ip-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 18px 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.2s;
    user-select: none;
    z-index: 100001;
}
.ip-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}
.ip-lightbox-arrow:active {
    transform: translateY(-50%) scale(0.95);
}
.arrow-prev { left: 30px; }
.arrow-next { right: 30px; }

.ip-lightbox-content {
    max-width: 80%;
    max-height: 80%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ip-lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.ip-gallery-lightbox.active .ip-lightbox-img {
    transform: scale(1);
}
.ip-lightbox-caption {
    margin-top: 15px;
    text-align: center;
    color: #fff;
    width: 100%;
}
.ip-lightbox-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.ip-lightbox-cat {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Pagination: Number */
.ip-gallery-pagination-wrapper {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
}
.ip-gallery-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ip-pag-btn, .ip-pag-num {
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}
.ip-pag-btn:hover:not(:disabled), .ip-pag-num:hover {
    background: #f8f9fa;
    border-color: #c8cbcf;
    color: var(--ip-primary-color);
}
.ip-pag-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.ip-pag-pages {
    display: flex;
    gap: 5px;
}
.ip-pag-num.active {
    background: var(--ip-primary-color);
    border-color: var(--ip-primary-color);
    color: #fff;
}

/* Pagination: Load More */
.ip-gallery-load-more-btn {
    background: var(--ip-primary-color);
    border: none;
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}
.ip-gallery-load-more-btn:hover {
    background: var(--ip-primary-hover);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}
.ip-gallery-load-more-btn:active {
    transform: translateY(0);
}
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: ip-spin 0.8s linear infinite;
}

/* Pagination: Infinite Loader */
.ip-gallery-infinite-loading {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
.ip-gallery-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--ip-primary-color);
    border-radius: 50%;
    animation: ip-spin 0.8s linear infinite;
}

@keyframes ip-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lazy Load Transition */
.ip-gallery-img.lazyload {
    opacity: 0;
    transition: opacity 0.5s ease;
}
.ip-gallery-img.lazyloaded {
    opacity: 1;
}

/* Empty State */
.ip-gallery-no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    font-size: 1.1rem;
}

/* Responsive Modes */
.ip-gallery-responsive.ip-gallery-container .ip-gallery-grid.layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
@media (max-width: 1024px) {
    .ip-gallery-grid.layout-masonry {
        column-count: 3;
    }
}
@media (max-width: 768px) {
    .ip-gallery-grid.layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 16px;
    }
    .ip-gallery-grid.layout-masonry {
        column-count: 2;
        column-gap: 16px;
    }
    .ip-gallery-grid.layout-masonry .ip-gallery-item {
        margin-bottom: 16px;
    }
    .ip-gallery-grid.layout-justified .ip-gallery-item {
        height: 180px;
    }
    .arrow-prev { left: 15px; }
    .arrow-next { right: 15px; }
    .ip-lightbox-arrow {
        padding: 12px 18px;
        font-size: 18px;
    }
}
@media (max-width: 480px) {
    .ip-gallery-grid.layout-grid {
        grid-template-columns: 1fr !important;
    }
    .ip-gallery-grid.layout-masonry {
        column-count: 1;
    }
    .ip-gallery-grid.layout-justified {
        flex-direction: column;
    }
    .ip-gallery-grid.layout-justified .ip-gallery-item {
        width: 100%;
        height: auto;
    }
}

/* Grid Wrapper & Loading States */
.ip-gallery-grid-wrapper {
    position: relative;
    width: 100%;
}
.ip-gallery-grid {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ip-gallery-grid.ip-loading {
    opacity: 0.25;
    pointer-events: none;
}
.ip-gallery-grid-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
    pointer-events: none;
}
.ip-gallery-grid.ip-loading + .ip-gallery-grid-loader {
    display: block;
}

