/* --- MODAL DIŞ KAPLAMA --- */
.polatlightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9) !important; /* Biraz daha koyu yaptım */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    touch-action: none; /* Mobilde sayfa kaymasını engeller */
}

/* --- İÇERİK ALANI --- */
.polatlightbox-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 0; /* Zoom yaparken kenar boşluğu sorun olmasın diye sıfırladık */
    box-sizing: border-box;
    overflow: hidden; /* Resim taşarsa gizle */
}

.polatlightbox-modal.polat-has-thumbs .polatlightbox-content {
    height: calc(100% - 90px);
}

/* --- RESİM AYARLARI --- */
.polatlightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;

    /* Transform origin JS ile yönetilecek ama varsayılan merkez */
    transform-origin: center center;
    will-change: transform;
    /* Transition JS tarafında dinamik eklenecek (performans için) */
}

@media only screen and (min-width: 992px) {
    .polatlightbox-content img {
        padding: 30px;
    }
}

/* --- CAPTION / TITLE --- */
.polatlightbox-caption {
    position: absolute;
    left: 0;
    bottom: 1px;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 10px;
    pointer-events: none;
    z-index: 20;
    font-size: 16px;
    font-family: sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.polatlightbox-modal.polat-has-thumbs .polatlightbox-caption {
    /*bottom: 15px;*/
}

/* --- THUMBNAIL BAR --- */
.polatlightbox-thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    box-sizing: border-box;
    z-index: 20;
    overflow-x: auto; /* Yatay scroll */
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x !important;
    cursor: grab;
    user-select: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.polatlightbox-thumbnails.active {
    cursor: grabbing;
}

.polatlightbox-thumbnails::-webkit-scrollbar {
    display: none;
}

.polat-thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin: 0 6px;
    cursor: pointer;
    opacity: 0.5;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    transition: all 0.2s ease;
    -webkit-user-drag: none;
    flex-shrink: 0; /* Küçülmeyi engelle */
}

.polat-thumb-img:hover, .polat-thumb-img.active {
    opacity: 1;
    border-color: #3498db;
    transform: scale(1.05);
}

/* --- OKLAR --- */
.polatlightbox-prev-btn, .polatlightbox-next-btn {
    position: absolute;
    cursor: pointer;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.3); /* Biraz daha belirgin */
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-size: 24px;
    width: 50px;
    height: 80px;
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.3s ease;
}

.polatlightbox-modal.polat-has-thumbs .polatlightbox-prev-btn,
.polatlightbox-modal.polat-has-thumbs .polatlightbox-next-btn {
    top: calc(50% - 45px);
}

.polatlightbox-prev-btn {
    left: 10px;
}

.polatlightbox-next-btn {
    right: 10px;
}

/* --- DİĞER (Loader, Close, Counter vb.) --- */
.polatlightbox-loader {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: polatSpin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -20px 0 0 -20px;
    z-index: 25;
}

@keyframes polatSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.polat-ui-element {
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.polat-idle-hide {
    opacity: 0 !important;
    visibility: hidden !important;
}

.polatlightbox-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 35px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    color: #fff;
}

.polatlightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 25;
    pointer-events: none;
}

.polatlightbox-trigger-galeri .ustkatman-polatlightbox-item:not(:first-child) {
    display: none !important;
}