:root {
    --main-color: rgba(183, 144, 36, 1);
    --secondary-color: rgba(41, 45, 100, 1);
}

.gallery-page {
    background: #f8f9fb;
    padding: 80px 0;
}

/* Filters */
.gallery-filters {
    background: #fff;
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.06);
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.gallery-filters__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}

.gallery-filters__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.filter-btn.active {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
}

.filter-btn i {
    font-size: 16px;
}

.filter-select {
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
    min-width: 180px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--main-color);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.gallery-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* Album Folder Cards */
.album-folder {
    display: block;
    color: inherit;
}

.album-folder__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 40%, rgba(41, 45, 100, 0.85));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    transition: all 0.4s ease;
}

.album-folder__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    opacity: 0;
    transition: all 0.4s ease;
}

.album-folder:hover .album-folder__icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.album-folder__count {
    background: var(--main-color);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(183, 144, 36, 0.4);
}

.gallery-item__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item__media {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.gallery-item__media img,
.gallery-item__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-item__media img,
.gallery-item:hover .gallery-item__media video {
    transform: scale(1.05);
}

.gallery-item__type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--main-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-item__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--main-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(183, 144, 36, 0.4);
}

.gallery-item:hover .gallery-item__play-btn {
    opacity: 1;
}

.gallery-item__info {
    padding: 20px;
}

.gallery-item__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item__occasion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.gallery-item__occasion i {
    color: var(--main-color);
}

/* Loading State */
.gallery-loading {
    display: none;
    text-align: center;
    padding: 60px;
}

.gallery-loading.active {
    display: block;
}

.gallery-loading__spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top-color: var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Results Counter */
.results-counter {
    background: transparent;
    padding: 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.results-counter__item {
    background: rgba(183, 144, 36, 0.1);
    color: var(--main-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.empty-gallery {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.06);
    grid-column: 1 / -1;
}

.empty-gallery__icon {
    font-size: 80px;
    color: #d1d5db;
    margin-bottom: 25px;
}

.empty-gallery__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.empty-gallery__desc {
    color: #6b7280;
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.pagination-wrapper .pagination {
    gap: 8px;
}

.pagination-wrapper .page-link {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    color: var(--secondary-color);
    font-weight: 600;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pagination-wrapper .page-item.active .page-link {
    background: var(--main-color);
    color: #fff;
}

.pagination-wrapper .page-link:hover {
    background: var(--main-color);
    color: #fff;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: var(--main-color);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    text-align: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
}

.lightbox-title {
    color: #fff;
    font-size: 18px;
    margin-top: 20px;
    font-weight: 600;
}

.lightbox-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 10px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.lightbox-nav:hover {
    background: var(--main-color);
}

.lightbox-nav.prev {
    right: 20px;
}

.lightbox-nav.next {
    left: 20px;
}

/* Mobile Responsiveness for Filters */
@media (max-width: 767px) {
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 15px;
        gap: 15px;
    }

    .gallery-filters__title {
        text-align: right;
        font-size: 16px;
        width: 100%;
        margin-bottom: 5px;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }

    .gallery-filters__btns {
        justify-content: flex-start;
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        font-size: 13px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    .filter-select {
        width: 100%;
        margin-top: 5px;
    }

    .results-counter {
        justify-content: space-between;
        width: 100%;
        margin-top: 5px;
        border-top: 1px dashed #eee;
        padding-top: 15px;
    }

    .results-counter__item {
        flex: 1;
        justify-content: center;
        margin: 0 5px;
    }
}