:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --bg-body: #f1f5f9;
    --text-main: #1e293b;
    --text-sec: #64748b;
    --border: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: var(--bg-body); color: var(--text-main); }

/* ==================== Header ==================== */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-flex {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 45px; height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.logo h1 { font-size: 1.3rem; color: var(--primary); line-height: 1; }
.logo span { font-size: 0.75rem; color: var(--text-sec); }

/* ==================== Hero Filter ==================== */
.hero-filter {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2.5rem 1rem 4rem 1rem;
    margin-bottom: 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}
.filter-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.filter-container h2 { font-size: 2rem; margin-bottom: 0.4rem; }
.filter-container p { opacity: 0.85; margin-bottom: 1.5rem; font-size: 0.95rem; }

/* Search bar di dalam hero */
.search-bar-hero {
    position: relative;
    max-width: 420px;
    margin: 0 auto 1.5rem;
}
.search-bar-hero input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border: none;
    background: white;
    color: var(--text-main);
    border-radius: 50px;
    font-family: 'Poppins';
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: 0.3s;
}
.search-bar-hero input::placeholder { color: var(--text-sec); }
.search-bar-hero input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.search-bar-hero i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sec);
    font-size: 0.85rem;
}

/* Filter row */
.filter-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-group label {
    font-size: 0.78rem;
    font-weight: 500;
    text-align: left;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}
.filter-group label i { font-size: 0.72rem; }

/* Custom select — pill shape */
.custom-select-wrapper {
    position: relative;
}
.custom-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: white;
    padding: 0.7rem 2.4rem 0.7rem 1rem;
    border-radius: 50px;
    font-family: 'Poppins';
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 210px;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: 0.3s;
}
.custom-select-wrapper select:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 0.65rem;
    pointer-events: none;
}

/* Button — seragam pill */
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-family: 'Poppins';
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ==================== Gallery Grid ==================== */
.gallery-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem 3rem 1rem; }
.gallery-grid { 
    display: grid; 
    /* Membuat kartu persegi panjang 4:3 (lebih tinggi) */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 1.5rem; 
}

.g-card { 
    position: relative;
    /* Rasio 4:3 -> 3 / 4 = 0.75 atau 75% */
    /* Atau gunakan aspect-ratio */
    aspect-ratio: 4/3; 
    
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
    cursor: pointer;
    background: #000; /* Background item saat load */
}

.g-card img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease; 
}

/* Gradient Overlay Effect */
.g-card .overlay-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(37, 99, 235, 0.8), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

/* Content Overlay (Title & Category) */
.g-card .overlay-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1.5rem;
    z-index: 2;
    text-align: left;
}

.g-card .g-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.3rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Biar jelas tanpa gradient awal */
    transition: transform 0.3s ease;
}

.g-card .g-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,255,255,0.15);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* Hover Animations */
.g-card:hover img { transform: scale(1.05); }
.g-card:hover .overlay-bg { opacity: 1; } /* Munculkan gradient biru */
.g-card:hover .g-title { transform: translateY(-2px); }

/* Multi Badge (Icon di pojok kanan atas) */
.multi-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 3;
    backdrop-filter: blur(4px);
}


/* Overlay zoom icon on hover */
.g-card::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 1.5rem;
    background: rgba(37, 99, 235, 0.75);
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    opacity: 0;
    z-index: 2;
}
.g-card:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
    height: 280px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== Pagination ==================== */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0 3rem;
}
.pagination-info {
    font-size: 0.8rem;
    color: var(--text-sec);
}
.pagination-info strong {
    color: var(--text-main);
    font-weight: 600;
}
.pagination-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Setiap tombol pagination — pill shape, seragam dengan tema */
.page-btn {
    min-width: 42px;
    height: 42px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: white;
    color: var(--text-main);
    font-family: 'Poppins';
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    transition: 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    user-select: none;
}
.page-btn:hover:not(.active):not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    cursor: default;
}
.page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.page-btn.nav-btn {
    padding: 0 1rem;
    gap: 5px;
    font-size: 0.8rem;
}
.page-btn.nav-btn i {
    font-size: 0.7rem;
}

/* Ellipsis */
.page-ellipsis {
    min-width: 32px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sec);
    font-weight: 600;
    letter-spacing: 2px;
    user-select: none;
}

/* ==================== Lightbox ==================== */
.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; flex-direction: column;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }

.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.1); border: none; color: white; width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; z-index: 10; }

.lightbox-slider-container {
    width: 90vw;
    max-width: 1000px;
    height: 75vh;
    overflow: hidden;
    position: relative;
    touch-action: pan-y pinch-zoom; /* Support native zoom */
}

.lightbox-slider {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
}

.lightbox-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Navigation */
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: none; color: white; width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; z-index: 10; transition: 0.2s;
}
.lightbox-nav:hover { background: var(--primary); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Dots Indicator */
.lightbox-dots { display: flex; gap: 8px; margin-top: 1rem; }
.lightbox-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: 0.2s; }
.lightbox-dot.active { background: var(--primary); width: 24px; border-radius: 10px; }

.lightbox-caption { position: absolute; bottom: 20px; color: white; background: rgba(0,0,0,0.7); padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; }
/* ========================================== */
/* CREATIVE PAGINATION STYLES (FIXED) */
/* ========================================== */
.pagination-container {
    /* Layout Utama: Flexbox dengan arah baris (horizontal) */
    display: flex;
    flex-direction: row; /* PAKSA HORISONTAL */
    flex-wrap: wrap;     /* Jika tidak muat, turun baris tapi tetap rapi */
    justify-content: center; /* Posisi Tengah Horizontal */
    align-items: center;     /* Posisi Tengah Vertikal */
    gap: 10px;               /* Jarak antar tombol */

    /* Ukuran & Posisi Container */
    width: fit-content;      /* Lebar menyesuaikan isi */
    margin: 3rem auto 0 auto; /* Atas 3rem, Kiri-Kanan Auto (Tengah) */
    
    /* Styling Tampilan (Glassmorphism) */
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.page-btn {
    /* Layout Tombol */
    display: inline-flex;     /* Agar icon sejajar tengah */
    align-items: center;
    justify-content: center;
    
    /* Ukuran Tombol (Bulat) */
    width: 42px;
    height: 42px;
    
    /* Style */
    border: none;
    border-radius: 50%;
    background: white;
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-3px); /* Efek mengangkat */
    box-shadow: 0 5px 10px rgba(37, 99, 235, 0.2);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
    transform: scale(1.1); /* Sedikit besar saat aktif */
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
    transform: none;
}

.page-dots {
    color: var(--text-sec);
    font-weight: bold;
    padding: 0 5px;
}

/* Responsive untuk Mobile */
@media (max-width: 600px) {
    .pagination-container {
        gap: 8px;
        padding: 0.8rem;
        border-radius: 35px;
    }
    .page-btn {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}

/* ==================== Responsive ==================== */
/* Mobile Swipe Hint */
@media (max-width: 768px) {
    .lightbox-nav { display: none; } /* Sembunyikan panah di mobile, andalkan swipe */
    .lightbox-slider-container { width: 100vw; height: 80vh; padding: 0; }
}
/* Responsive */
@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .g-card { aspect-ratio: 1/1; } /* Bisa diubah jadi square di mobile jika perlu */
    .g-card .g-title { font-size: 0.9rem; }
}
@media (max-width: 768px) {
    .header-flex { padding: 0.85rem 1.25rem; }
    .filter-container h2 { font-size: 1.4rem; }
    .filter-container p { font-size: 0.85rem; margin-bottom: 1.2rem; }
    .search-bar-hero { max-width: 100%; }
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0 0.5rem;
    }
    .filter-group label { text-align: center; justify-content: center; }
    .custom-select-wrapper select { width: 100%; min-width: unset; }
    .btn-primary { width: 100%; justify-content: center; }


    .g-card .g-card-img-wrap { height: 140px; }
    .g-card-body { padding: 0.65rem; }
    .g-card-title { font-size: 0.82rem; margin-bottom: 0.3rem; }
    .g-card-tag { font-size: 0.62rem; }
    .g-card::after { width: 38px; height: 38px; font-size: 1rem; }

    /* Pagination mobile */
    .page-btn {
        min-width: 38px;
        height: 38px;
        font-size: 0.8rem;
    }
    .page-btn.nav-btn {
        padding: 0 0.75rem;
        font-size: 0.75rem;
    }

    /* Lightbox mobile */
    .lightbox-overlay { padding: 0.75rem; }
    .lightbox-content img {
        max-width: calc(100vw - 2.5rem);
        max-height: 65vh;
        border-radius: 8px;
    }
    .lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 0.9rem; }
    .lightbox-caption { font-size: 0.78rem; max-width: 90vw; margin-top: 0.75rem; }
}

@media (max-width: 400px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .g-card .g-card-img-wrap { height: 180px; }
    .page-btn { min-width: 34px; height: 34px; font-size: 0.75rem; }
}