/**
 * Makarnam Penne - Galeri Sayfası Stilleri
 */

/* Gallery filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.gallery-filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius-full);
    background: var(--bg-card);
    border: 1px solid var(--color-gray-200);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Masonry-like grid */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .gallery-masonry {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-masonry .gallery-item:nth-child(5n+1) {
    grid-row: span 2;
}

/* Gallery Item enhanced */
.gallery-item {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.gallery-masonry .gallery-item:nth-child(5n+1) {
    aspect-ratio: auto;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
}

.gallery-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.gallery-category {
    color: var(--color-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Video overlay */
.gallery-item[data-type="video"] .gallery-overlay-icon {
    background: var(--color-secondary);
    color: #000;
}

.gallery-item[data-type="video"] .gallery-overlay-icon::before {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

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

.lightbox.active {
    display: flex;
}

.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: var(--color-secondary);
    color: #000;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    text-align: center;
}

.lightbox-counter {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Animation for items */
.gallery-item {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.05s;
}

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

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

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

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

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

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

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

/* Load more button */
.load-more-btn {
    display: block;
    width: 200px;
    margin: 2rem auto 0;
    padding: 0.875rem;
    border-radius: var(--border-radius-full);
    background: var(--bg-card);
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Loading spinner */
.gallery-loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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