/* Gallery Section Styles */
.gallery-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1.2s ease-out;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1D2D4A 0%, #3498db 100%);
    animation: shimmer 3s infinite;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #1D2D4A;
    margin-bottom: 40px;
    font-weight: 700;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1.4s ease-out;
    background: linear-gradient(135deg, #1D2D4A 0%, #3498db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-categories {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    background: rgba(236, 240, 241, 0.8);
    border: 2px solid transparent;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #1D2D4A;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.category-btn:hover,
.category-btn.active {
    background: linear-gradient(135deg, #1D2D4A 0%, #3498db 100%);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(29, 45, 74, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    border: 2px solid transparent;
    animation: fadeInUp 0.8s ease-out;
}

/* Shine overlay for gallery items */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 40%;
    height: 100%;
    background: linear-gradient(115deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.65) 45%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 4;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(29, 45, 74, 0.1) 0%, rgba(52, 152, 219, 0.1) 100%);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover {
    box-shadow: 0 10px 25px rgba(29, 45, 74, 0.2);
}

/* Trigger shine on hover */
.gallery-item:hover::after {
    animation: gallery-shine 1.2s ease;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    loading: lazy;
    decoding: async;
    filter: blur(0);
    transform: translateZ(0);
    will-change: transform;
}

.gallery-item:hover img {
    filter: brightness(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(29, 45, 74, 0.9));
    color: white;
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: all 0.3s ease;
    z-index: 3;
    backdrop-filter: blur(10px);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
    background: linear-gradient(transparent, rgba(29, 45, 74, 0.95));
}

.gallery-overlay h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

@keyframes gallery-shine {
    0% { left: -120%; }
    100% { left: 140%; }
}

/* Responsive Design for Gallery */
@media (max-width: 768px) {
    .gallery-section {
        padding: 40px 0;
    }
    .gallery-categories {
        gap: 6px;
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        scrollbar-width: none;
        padding: 0 8px;
    }
    .gallery-categories::-webkit-scrollbar { display: none; }
    
    .category-btn {
        padding: 6px 12px;
        font-size: clamp(12px, 3.5vw, 14px);
        white-space: nowrap;
        flex: 0 0 auto;
    }

    /* Make first (Tümü) full width on first row */
    .gallery-categories .category-btn:first-child {
        flex: 0 0 100%;
        text-align: center;
    }

    /* Make remaining 4 fit one row beneath exactly */
    .gallery-categories .category-btn:not(:first-child) {
        flex: 0 0 calc((100% - 18px) / 4); /* 3 gaps x 6px = 18px */
        text-align: center;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-title {
        font-size: clamp(1rem, 5.2vw, 2rem);
        white-space: nowrap;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 30px 0;
    }
    .gallery-categories {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 6px;
    }
    
    .category-btn {
        padding: 5px 10px;
        font-size: clamp(11px, 3.8vw, 13px);
    }

    .gallery-categories .category-btn:first-child {
        flex-basis: 100%;
    }
    .gallery-categories .category-btn:not(:first-child) {
        flex: 0 0 calc((100% - 18px) / 4);
    }
    
    .section-title {
        font-size: clamp(1rem, 5.2vw, 1.6rem);
        white-space: nowrap;
        margin-bottom: 12px;
    }
}

/* Ultra-small devices */
@media (max-width: 360px) {
    .gallery-categories {
        gap: 6px;
    }
    .category-btn {
        font-size: 11.5px;
        padding: 4px 8px;
    }
    .section-title {
        font-size: clamp(0.95rem, 5vw, 1.4rem);
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-in-out;
}

.lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: all;
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

#lightbox-image {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    loading: eager;
    decoding: async;
    filter: blur(0);
    transform: translateZ(0);
    will-change: transform;
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.lightbox-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.lightbox-info p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Lightbox */
@media (max-width: 768px) {
    .lightbox-content {
        width: 95%;
        height: 95%;
        padding: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 25px;
        padding: 12px 15px;
    }
    
    .lightbox-info {
        bottom: 10px;
        padding: 10px 20px;
    }
    
    .lightbox-info h3 {
        font-size: 1.2rem;
    }
    
    .lightbox-info p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .lightbox-nav {
        padding: 0 10px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 10px 12px;
    }
    
    .lightbox-info {
        padding: 8px 15px;
    }
    
    .lightbox-info h3 {
        font-size: 1rem;
    }
    
    .lightbox-info p {
        font-size: 0.8rem;
    }
}
