/* Pagination styles */

body.lightbox-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.gallery-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}
.gallery {
    max-width: 100%;
    overflow-x: hidden;
}
img, video {
    max-width: 100%;
    height: auto;
}
.lightbox {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}
.page-btn {
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 20px;

}

.page-btn.active {
    background: #2890B4;;
    color: white;
    border-color: #2890B4;;
}

.page-btn:hover:not(.active) {
    background: #f5f5f5;
}

/* Lightbox core styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.97);
    z-index: 9999;
    overflow-y: auto;
    overscroll-behavior: contain; /* Önemli */
    -webkit-overflow-scrolling: touch;
}

.lightbox.active {
     display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
     position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95vw;
    max-height: 95vh;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    margin: auto;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    max-width: 80vw;
}

/* Navigation buttons */
.nav-buttons-container {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    padding: 0 20px;
    pointer-events: none;
}

.nav-btn {
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(40, 144, 180, 0.8);
    transform: scale(1.1);
}

/* Close button */
.close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 10002;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #2890B4;
    transform: rotate(90deg);
}

/* Gallery styles */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    background: #fff;
    cursor: pointer;
    min-height: 300px;
    width: 300px;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.gallery-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* Animations */
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .lightbox {
        padding: 10px;
    }

    .lightbox-img {
        max-height: calc(90vh - 50px);
    }

    .lightbox-caption {
        font-size: 1rem;
        margin: 10px auto 0;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .close-btn {
        top: 15px;
        right: 15px;
        font-size: 35px;
    }

     .lightbox-content {
        padding: 20px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .gallery-pagination {
        flex-wrap: wrap;
    }

    .page-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .lightbox-img {
        max-height: 60vh;
    }

    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .close-btn {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .page-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}