/* =============================================
   GALLERY LOADER — Album ảnh Thủy Long
   ============================================= */

/* ---------- Variables ---------- */
:root {
    --gl-primary: #1a5c3a;
    --gl-primary-light: #2d8a5e;
    --gl-gold: #c8a45a;
    --gl-gold-light: #e2c97e;
    --gl-dark: #1a1a2e;
    --gl-dark-light: #16213e;
    --gl-text: #2d3436;
    --gl-text-light: #636e72;
    --gl-bg: #f8f9fa;
    --gl-white: #ffffff;
    --gl-radius: 12px;
    --gl-radius-lg: 20px;
    --gl-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --gl-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --gl-transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- Section Container ---------- */
.gl-section {
    padding: 80px 0;
    background: var(--gl-bg);
    position: relative;
    overflow: hidden;
}

.gl-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(26, 92, 58, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.gl-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Section Header ---------- */
.gl-header {
    text-align: center;
    margin-bottom: 48px;
}

.gl-header__eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gl-gold);
    margin-bottom: 12px;
    position: relative;
}

.gl-header__eyebrow::before,
.gl-header__eyebrow::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 1px;
    background: var(--gl-gold);
    vertical-align: middle;
    margin: 0 12px;
}

.gl-header__title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    color: var(--gl-dark);
    margin: 0 0 16px;
    line-height: 1.2;
}

.gl-header__desc {
    font-size: 16px;
    color: var(--gl-text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- Album Filter Tabs ---------- */
.gl-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.gl-tab {
    padding: 10px 24px;
    border: 2px solid transparent;
    border-radius: 50px;
    background: var(--gl-white);
    color: var(--gl-text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--gl-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    user-select: none;
}

.gl-tab:hover {
    border-color: var(--gl-primary-light);
    color: var(--gl-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 92, 58, 0.12);
}

.gl-tab.active {
    background: linear-gradient(135deg, var(--gl-primary), var(--gl-primary-light));
    color: var(--gl-white);
    border-color: var(--gl-primary);
    box-shadow: 0 4px 16px rgba(26, 92, 58, 0.3);
}

.gl-tab__count {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    margin-left: 6px;
}

.gl-tab.active .gl-tab__count {
    background: rgba(255, 255, 255, 0.3);
}

/* ---------- Photo Grid ---------- */
.gl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gl-grid--loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Photo Card ---------- */
.gl-card {
    position: relative;
    border-radius: var(--gl-radius);
    overflow: hidden;
    background: var(--gl-white);
    box-shadow: var(--gl-shadow);
    cursor: pointer;
    transition: var(--gl-transition);
    animation: glFadeIn 0.5s ease-out both;
}

.gl-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--gl-shadow-hover);
}

.gl-card__img-wrap {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

.gl-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gl-card:hover .gl-card__img {
    transform: scale(1.08);
}

.gl-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.gl-card:hover .gl-card__overlay {
    opacity: 1;
}

.gl-card__zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--gl-transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.gl-card:hover .gl-card__zoom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gl-card__zoom svg {
    width: 22px;
    height: 22px;
    color: var(--gl-primary);
}

.gl-card__info {
    padding: 14px 16px;
}

.gl-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gl-dark);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-card__caption {
    font-size: 12px;
    color: var(--gl-text-light);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Lightbox ---------- */
.gl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.gl-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.gl-lightbox__inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gl-lightbox__img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
}

.gl-lightbox__caption {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-top: 16px;
    font-size: 15px;
    max-width: 600px;
    line-height: 1.5;
}

.gl-lightbox__caption strong {
    display: block;
    font-size: 17px;
    margin-bottom: 4px;
    color: #fff;
}

.gl-lightbox__close {
    position: absolute;
    top: -50px;
    right: -10px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gl-transition);
    backdrop-filter: blur(10px);
}

.gl-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.gl-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gl-transition);
    backdrop-filter: blur(10px);
}

.gl-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.gl-lightbox__nav--prev {
    left: -70px;
}

.gl-lightbox__nav--next {
    right: -70px;
}

.gl-lightbox__counter {
    position: absolute;
    top: -50px;
    left: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

/* ---------- Empty State ---------- */
.gl-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gl-text-light);
}

.gl-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.gl-empty__text {
    font-size: 16px;
    margin: 0;
}

/* ---------- Loading Spinner ---------- */
.gl-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(26, 92, 58, 0.15);
    border-top-color: var(--gl-primary);
    border-radius: 50%;
    animation: glSpin 0.8s linear infinite;
}

/* ---------- Animations ---------- */
@keyframes glFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Stagger animation for cards */
.gl-card:nth-child(1) { animation-delay: 0.05s; }
.gl-card:nth-child(2) { animation-delay: 0.1s; }
.gl-card:nth-child(3) { animation-delay: 0.15s; }
.gl-card:nth-child(4) { animation-delay: 0.2s; }
.gl-card:nth-child(5) { animation-delay: 0.25s; }
.gl-card:nth-child(6) { animation-delay: 0.3s; }
.gl-card:nth-child(7) { animation-delay: 0.35s; }
.gl-card:nth-child(8) { animation-delay: 0.4s; }
.gl-card:nth-child(9) { animation-delay: 0.45s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .gl-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .gl-lightbox__nav--prev { left: 10px; }
    .gl-lightbox__nav--next { right: 10px; }
}

@media (max-width: 768px) {
    .gl-section { padding: 50px 0; }
    .gl-container { padding: 0 16px; }

    .gl-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gl-card__info { padding: 10px 12px; }
    .gl-card__title { font-size: 13px; }

    .gl-tabs { gap: 6px; }
    .gl-tab { padding: 8px 16px; font-size: 13px; }

    .gl-lightbox__close { top: 10px; right: 10px; }
    .gl-lightbox__counter { top: 16px; left: 16px; }
    .gl-lightbox__nav { width: 40px; height: 40px; }
    .gl-lightbox__nav--prev { left: 8px; }
    .gl-lightbox__nav--next { right: 8px; }
}

@media (max-width: 480px) {
    .gl-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .gl-card { border-radius: 8px; }
    .gl-card__info { padding: 8px 10px; }
    .gl-card__caption { display: none; }

    .gl-header__eyebrow::before,
    .gl-header__eyebrow::after {
        width: 16px;
        margin: 0 8px;
    }
}
