/* ============================================
   GALLERY-PREMIUM.CSS - Gallery Section Styles
   Çerçeve Atölyesi Premium Website
   ============================================ */

/* ============================================
   GALLERY SECTION
   ============================================ */

.gallery {
    padding: 100px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
    position: relative;
}

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(201, 169, 89, 0.2) 50%,
        transparent 100%
    );
}

/* ============================================
   GALLERY FILTERS
   ============================================ */

.gallery__filters {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.gallery__filter {
    padding: 12px 28px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #666;
    background: #ffffff;
    border: 2px solid rgba(201, 169, 89, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gallery__filter:hover {
    color: #C9A959;
    border-color: rgba(201, 169, 89, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 89, 0.2);
}

.gallery__filter--active {
    color: #ffffff;
    background: linear-gradient(135deg, #C9A959 0%, #E8D39F 100%);
    border-color: #C9A959;
    box-shadow: 0 4px 16px rgba(201, 169, 89, 0.3);
}

.gallery__filter--active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 89, 0.4);
}

/* ============================================
   GALLERY GRID - MASONRY LAYOUT
   ============================================ */

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 48px;
}

/* ============================================
   GALLERY ITEMS
   ============================================ */

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    background: #f5f5f5;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    aspect-ratio: 4 / 3;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   GALLERY ITEM IMAGE
   ============================================ */

.gallery-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-item__image {
    transform: scale(1.1);
}

/* ============================================
   GALLERY ITEM OVERLAY
   ============================================ */

.gallery-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 3;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-item__overlay {
    transform: translateY(0);
}

.gallery-item__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.gallery-item__category {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    display: inline-block;
    padding: 6px 16px;
    background: rgba(201, 169, 89, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   GALLERY ITEM STATES
   ============================================ */

.gallery-item.hidden {
    display: none;
}

.gallery-item.fade-in {
    animation: fadeInScale 0.5s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox__container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: lightboxZoom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lightboxZoom {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox__image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ============================================
   LIGHTBOX CONTROLS
   ============================================ */

.lightbox__close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    transition: all 0.3s ease;
}

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

.lightbox__prev,
.lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox__prev {
    left: 20px;
}

.lightbox__next {
    right: 20px;
}

.lightbox__prev:hover,
.lightbox__next:hover {
    background: rgba(201, 169, 89, 0.8);
    border-color: #C9A959;
}

/* ============================================
   LIGHTBOX INFO
   ============================================ */

.lightbox__info {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffffff;
}

.lightbox__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.lightbox__category {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.lightbox__counter {
    position: absolute;
    top: -50px;
    left: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

/* ============================================
   LOADING STATE
   ============================================ */

.gallery-item.loading {
    position: relative;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(201, 169, 89, 0.2);
    border-top-color: #C9A959;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 1024px) {
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .gallery-item {
        aspect-ratio: 1;
    }
}

@media (max-width: 768px) {
    .gallery {
        padding: 80px 0;
    }

    .gallery__filters {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .gallery__filters::-webkit-scrollbar {
        display: none;
    }

    .gallery__filter {
        white-space: nowrap;
        font-size: 0.875rem;
        padding: 10px 20px;
    }

    .gallery__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .lightbox__container {
        max-width: 95vw;
    }

    .lightbox__prev,
    .lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox__prev {
        left: 10px;
    }

    .lightbox__next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery {
        padding: 60px 0;
    }

    .gallery__filters {
        gap: 8px;
        margin-bottom: 32px;
    }

    .gallery__filter {
        font-size: 0.8125rem;
        padding: 8px 16px;
    }

    .gallery-item__title {
        font-size: 1.125rem;
    }

    .gallery-item__category {
        font-size: 0.8125rem;
        padding: 4px 12px;
    }

    .lightbox__close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .lightbox__info {
        bottom: 10px;
        left: 10px;
        right: 10px;
        text-align: left;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
        padding: 16px;
        border-radius: 12px;
    }

    .lightbox__counter {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.75rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .gallery__filters,
    .lightbox {
        display: none !important;
    }

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

    .gallery-item {
        page-break-inside: avoid;
    }
}
