.gallery-section {
    margin-top: 60px;
    margin-bottom: 40px;
}

.gallery-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

.gallery-grid::-webkit-scrollbar {
    height: 8px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb);
}

.gallery-item {
    flex: 0 0 280px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--glass-highlight);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--glass-bg-dark-strong), var(--glass-bg-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-placeholder::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--track-bg);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(28px) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(28px) saturate(var(--glass-saturate));
}

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

.lightbox-overlay.active .lightbox-content {
    animation: lightboxOpen 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay:not(.active) .lightbox-content {
    animation: lightboxClose 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform-origin: center;
}

.lightbox-image {
    width: auto;
    height: auto;
    max-width: min(80vw, 1200px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.lightbox-image.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.lightbox-image.fade-in {
    animation: imageFadeIn 0.3s ease;
}

@keyframes lightboxOpen {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes lightboxClose {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes imageFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-placeholder {
    width: 80vw;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--glass-bg-dark-strong), var(--glass-bg-dark));
    border-radius: var(--radius-lg);
    border: 1px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-placeholder::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid var(--track-bg);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lightbox-counter {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--glass-bg-strong);
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close .ui-icon,
.lightbox-prev .ui-icon,
.lightbox-next .ui-icon {
    font-size: 28px;
}

@media (max-width: 768px) {
    .gallery-item {
        flex: 0 0 200px;
    }
    
    .gallery-grid {
        gap: 15px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
}
