/* ==========================================================================
   Gallery category filter — single glassmorphism slide-in panel.
   Replaces the old flex-row/max-height dropdown menu (which had a
   "transition: all" on its base rule, causing a visible layout-property
   animation glitch that looked like two different menus flashing).
   All motion here is transform/opacity only — no layout properties are
   ever animated, so there is nothing left to glitch.
   ========================================================================== */

.gallery-filter-section {
    position: relative;
    direction: rtl;
}

/* ---- Trigger button ---- */
.gallery-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 18px auto 24px;
    padding: 11px 20px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f1f1f1;
    font-size: 14px;
    cursor: pointer;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}

.gallery-filter-trigger:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .22);
    transform: translateY(-1px);
}

.gallery-filter-trigger i {
    color: #b69d74;
    font-size: 15px;
}

.gallery-filter-section > .container:first-of-type,
.gallery-filter-trigger {
    display: flex;
    width: fit-content;
}

/* ---- Backdrop ---- */
.gallery-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(6, 6, 8, .45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}

.gallery-filter-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s ease, visibility 0s linear 0s;
}

/* ---- Glass panel ---- */
.gallery-filter-panel {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1201;
    width: min(320px, calc(100vw - 40px));
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(24, 24, 28, .55);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
    transform: translateX(24px) scale(.97);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .32s cubic-bezier(.16, 1, .3, 1), opacity .28s ease, visibility 0s linear .32s;
}

.gallery-filter-panel.is-open {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .32s cubic-bezier(.16, 1, .3, 1), opacity .28s ease, visibility 0s linear 0s;
}

.gallery-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.gallery-filter-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f5;
    font-family: 'estedad-lightbold', var(--font-family-base);
}

.gallery-filter-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    color: #d8d8d8;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.gallery-filter-close:hover {
    background: rgba(255, 255, 255, .12);
    transform: rotate(90deg);
}

/* ---- Category list ---- */
.gallery-filter-list {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-filter-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 3px;
    height: 46px;
    border-radius: 6px;
    background: linear-gradient(180deg, #d8b988, #b69d74);
    box-shadow: 0 0 14px rgba(182, 157, 116, .7);
    transform: translateY(0);
    opacity: 0;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .2s ease, height .3s cubic-bezier(.16, 1, .3, 1);
}

.gallery-filter-indicator.is-visible {
    opacity: 1;
}

.gallery-filter-link {
    display: block;
    padding: 13px 18px;
    border-radius: 14px;
    color: #cfcfcf;
    font-size: 14px;
    font-family: 'estedad-light', var(--font-family-base);
    text-decoration: none;
    letter-spacing: .2px;
    transition: background-color .22s ease, color .22s ease, transform .22s ease;
}

.gallery-filter-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transform: translateX(-2px);
}

.gallery-filter-link.is-active {
    background: rgba(182, 157, 116, .14);
    color: #f1e4cf;
    font-family: 'estedad-lightbold', var(--font-family-base);
}

/* ---- Loading bar ---- */
.gallery-loading-bar {
    position: relative;
    height: 3px;
    margin-bottom: 14px;
    border-radius: 3px;
    overflow: hidden;
    background: transparent;
}

.gallery-loading-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, #b69d74, transparent);
    transform: translateX(-100%);
    opacity: 0;
    transition: opacity .2s ease;
}

.gallery-loading-bar.is-loading::before {
    opacity: 1;
    animation: gallery-loading-sweep 1s ease-in-out infinite;
}

@keyframes gallery-loading-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ---- Grid fade transition ---- */
.demo-gallery {
    transition: opacity .22s ease;
}

.demo-gallery.is-fading {
    opacity: 0;
}

@media (max-width: 480px) {
    .gallery-filter-panel {
        top: 76px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 100px);
    }
}

/* ---- Pagination: glass pill numbers, centered ----
   Scoped to #galleryPagination so it doesn't touch pagination elsewhere
   on the site (Laravel's default Bootstrap-4 pagination view: page-item/
   page-link, wired app-wide via Paginator::useBootstrap()). */
#galleryPagination {
    margin-top: 40px;
}

#galleryPagination .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#galleryPagination .page-item {
    display: flex;
}

#galleryPagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #cfcfcf;
    font-size: 14px;
    font-family: 'estedad-light', var(--font-family-base);
    line-height: 1;
    transition: background-color .22s ease, border-color .22s ease, color .22s ease, transform .22s ease;
}

#galleryPagination .page-link:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
    color: #fff;
    transform: translateY(-2px);
}

#galleryPagination .page-item.active .page-link {
    background: linear-gradient(135deg, #d8b988, #b69d74);
    border-color: transparent;
    color: #1a1a1a;
    font-family: 'estedad-lightbold', var(--font-family-base);
    box-shadow: 0 6px 18px rgba(182, 157, 116, .45);
}

#galleryPagination .page-item.disabled .page-link {
    opacity: .35;
    pointer-events: none;
    transform: none;
}
