/* ============================================
   GALLERY PAGE STYLES
   ============================================ */

.gallery-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://res.cloudinary.com/domutc3bw/image/upload/q_auto,f_auto/v1776859169/baba.com_island_s7x4nq.png');
    background-size: cover;
    background-position: center;
    z-index: -1;
    opacity: 0.75;
    filter: blur(25px);
    pointer-events: none;
    transform: scale(1.12);
    transform-origin: center;
}

/* ============================================
   GALLERY SEARCH
   ============================================ */

.gallery-search-section {
    padding: 130px 5% 0;
}

.gallery-search-wrapper {
    max-width: 560px;
    margin: 0 auto;
}

.gallery-search-box {
    position: relative;
    width: 100%;
}

.gallery-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.gallery-search-input {
    width: 100%;
    padding: 0.95rem 1.2rem 0.95rem 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.gallery-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.gallery-search-input:focus {
    border-color: var(--primary-cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.2);
}

.gallery-search-input:focus~.gallery-search-icon,
.gallery-search-input:not(:placeholder-shown)~.gallery-search-icon {
    color: var(--primary-cyan);
}

/* ============================================
   CATEGORY NAVIGATION
   ============================================ */

.gallery-categories-section {
    padding: 1.75rem 5% 0;
}

.gallery-categories {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-pill {
    padding: 0.55rem 1.35rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.category-pill:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.category-pill.active {
    color: var(--dark-bg);
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.25);
    font-weight: 600;
}

/* ============================================
   GALLERY MASONRY GRID
   ============================================ */

.gallery-section {
    padding: 2.5rem 5% 4rem;
}

.gallery-grid {
    columns: 3;
    column-gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.gallery-item.is-hidden {
    display: none;
}

.gallery-item.is-fading {
    opacity: 0;
    transform: translateY(12px);
}

.gallery-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.gallery-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.gallery-img.is-loaded {
    opacity: 1;
}

.gallery-link:hover .gallery-img.is-loaded {
    transform: scale(1.03);
}

.gallery-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.gallery-link:hover::after {
    opacity: 1;
}

/* Image Placeholder / Shimmer */
.gallery-img-placeholder {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.gallery-img.is-loaded+.gallery-img-placeholder {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

/* Size variants */
.gallery-item--large {
    break-inside: avoid;
}

.gallery-item--large .gallery-link {
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.gallery-item--large .gallery-img {
    border-radius: 16px;
}

.gallery-item--medium {
    break-inside: avoid;
}

.gallery-item--normal {
    break-inside: avoid;
}

/* Sentinel / Loader */
.gallery-sentinel {
    display: flex;
    justify-content: center;
    padding: 2rem 0 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-sentinel.is-active {
    opacity: 1;
}

.gallery-loader {
    display: flex;
    gap: 6px;
    align-items: center;
}

.gallery-loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-cyan);
    opacity: 0.4;
    animation: loaderPulse 1.2s ease-in-out infinite;
}

.gallery-loader-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.gallery-loader-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes loaderPulse {
    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* No Results */
.gallery-no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.4);
}

.gallery-no-results i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.3;
}

.gallery-no-results p {
    font-size: 1.2rem;
}

/* ============================================
   RESPONSIVE: Tablet (992px)
   ============================================ */

@media (max-width: 992px) {
    .gallery-search-section {
        padding-top: 110px;
    }

    .gallery-grid {
        columns: 3;
        column-gap: 10px;
    }

    .gallery-item {
        margin-bottom: 10px;
    }

    .gallery-section {
        padding: 2rem 5% 3rem;
    }
}

/* ============================================
   RESPONSIVE: Tablet Small (768px)
   ============================================ */

@media (max-width: 768px) {
    .gallery-grid {
        columns: 2;
        column-gap: 8px;
    }

    .gallery-item {
        margin-bottom: 8px;
    }

    .gallery-search-section {
        padding-top: 90px;
    }

    .gallery-search-wrapper {
        max-width: 100%;
    }

    .gallery-categories {
        gap: 0.35rem;
    }

    .category-pill {
        padding: 0.45rem 1rem;
        font-size: 0.9rem;
    }

    .gallery-section {
        padding: 1.5rem 5% 3rem;
    }
}

/* ============================================
   RESPONSIVE: Mobile (600px)
   ============================================ */

@media (max-width: 600px) {
    .gallery-grid {
        columns: 2;
        column-gap: 6px;
    }

    .gallery-item {
        margin-bottom: 6px;
    }

    .gallery-search-input {
        font-size: 0.88rem;
        padding: 0.8rem 1rem 0.8rem 2.7rem;
        border-radius: 12px;
    }

    .gallery-section {
        padding: 1.2rem 5% 2rem;
    }
}

/* ============================================
   RESPONSIVE: Very Small Mobile (400px)
   ============================================ */

@media (max-width: 400px) {
    .gallery-grid {
        columns: 2;
        column-gap: 6px;
    }

    .gallery-item {
        margin-bottom: 6px;
    }
}
