/* ==========================================
   GALLERY PAGE STYLES
   Matches Premium-style design of the home page
   ========================================== */

/* ── Hero ───────────────────────────────── */
.gallery-hero {
    position: relative;
    width: 100%;
    min-height: 55vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 120px 5% 80px;
    box-sizing: border-box;
}

.gallery-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0d0d0d 100%);
    z-index: 0;
}

.gallery-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(211, 47, 47, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(197, 160, 89, 0.06) 0%, transparent 50%);
}

.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: galleryFadeUp 1s cubic-bezier(0.2, 0, 0.2, 1) 0.2s forwards;
}

.gallery-hero-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-red, #d32f2f);
    margin-bottom: 1rem;
}

@keyframes galleryFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Filter Bar ─────────────────────────── */
.gallery-filter-bar {
    position: sticky;
    top: 100px;
    /* Below nav */
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 5%;
}

.gallery-filter-inner {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 22px;
    border-radius: 980px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    letter-spacing: 0.02em;
}

.filter-chip:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.filter-chip.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.04);
}

/* ── Gallery Section ────────────────────── */
.gallery-section {
    background: #000;
    padding: 60px 5% 100px;
    min-height: 50vh;
}

/* Masonry-style grid */
.gallery-grid {
    columns: 4 280px;
    column-gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
}

.gallery-card {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #111;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    animation: cardReveal 0.6s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1), filter 0.5s ease;
    will-change: transform;
}

.gallery-card:hover img {
    transform: scale(1.04);
    filter: brightness(1.05);
}

/* Overlay on hover */
.gallery-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: 12px;
}

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

.gallery-card-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
}

.gallery-card:hover .gallery-card-caption {
    opacity: 1;
    transform: translateY(0);
}

.gallery-card-album {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

/* Staggered reveal */
.gallery-card:nth-child(1) {
    animation-delay: 0.05s;
}

.gallery-card:nth-child(2) {
    animation-delay: 0.1s;
}

.gallery-card:nth-child(3) {
    animation-delay: 0.15s;
}

.gallery-card:nth-child(4) {
    animation-delay: 0.2s;
}

.gallery-card:nth-child(5) {
    animation-delay: 0.25s;
}

.gallery-card:nth-child(6) {
    animation-delay: 0.3s;
}

.gallery-card:nth-child(7) {
    animation-delay: 0.35s;
}

.gallery-card:nth-child(8) {
    animation-delay: 0.4s;
}

.gallery-card:nth-child(9) {
    animation-delay: 0.45s;
}

.gallery-card:nth-child(10) {
    animation-delay: 0.5s;
}

.gallery-card:nth-child(11) {
    animation-delay: 0.55s;
}

.gallery-card:nth-child(12) {
    animation-delay: 0.6s;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Video Support ──────────────────────── */
.video-card video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.gallery-card:hover video {
    transform: scale(1.04);
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
    z-index: 1;
}

.gallery-card:hover .video-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.play-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.play-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #fff;
}

.gallery-card:hover .play-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.lightbox-content video {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

/* Hidden card (filtered out) */
.gallery-card.hidden {
    display: none;
}

/* ── Empty State ────────────────────────── */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.gallery-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.gallery-empty p {
    font-size: 18px;
    margin-bottom: 8px;
}

.gallery-empty-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.25);
}

/* ── Lightbox ───────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    max-width: 600px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 36px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s, transform 0.3s;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    color: #fff;
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.08);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-counter {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ── Active nav link ────────────────────── */
.active-link {
    color: var(--accent-red, #d32f2f) !important;
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
    .gallery-hero {
        min-height: 40vh;
        padding: 80px 5% 50px;
    }

    .gallery-filter-bar {
        top: 70px;
        padding: 12px 4%;
    }

    .filter-chip {
        padding: 6px 16px;
        font-size: 13px;
    }

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

    .gallery-card {
        margin-bottom: 10px;
        border-radius: 8px;
    }

    .gallery-section {
        padding: 30px 4% 60px;
    }

    .lightbox-arrow {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }
}

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

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

/* ── Admin Styles ───────────────────────── */
#galleryUploadBtn {
    background: var(--accent-red, #d32f2f);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 980px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

#galleryUploadBtn:hover {
    background: #e53935;
}

.gallery-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-card:hover .gallery-delete-btn {
    opacity: 1;
}