/**
 * Custom Slider & Lightbox CSS
 * Tombol panah di bawah gambar - posisi justify
 */

/* ========== SLIDER CAROUSEL ========== */
.csl-slider-wrapper {
    margin: 20px auto;
    position: relative;
}

.csl-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.csl-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.csl-slide {
    display: none;
    width: 100%;
    text-align: center;
    animation: fadeEffect 0.5s ease-in-out;
}

@keyframes fadeEffect {
    from { opacity: 0; }
    to { opacity: 1; }
}

.csl-slide.active {
    display: block;
}

.csl-slide-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
}

.csl-slide-img:hover {
    opacity: 0.95;
    transform: scale(1.01);
}

/* Tombol navigasi slider (panah di kiri/kanan gambar slider) */
.csl-prev, 
.csl-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    font-weight: bold;
}

.csl-prev {
    left: 10px;
}

.csl-next {
    right: 10px;
}

.csl-prev:hover, 
.csl-next:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.05);
}

/* Indikator dot */
.csl-dots {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.5);
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

.csl-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 6px;
    background: #bbb;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.csl-dot:hover {
    background: #fff;
    transform: scale(1.2);
}

.csl-dot.active {
    background: #fff;
    transform: scale(1.1);
}

/* ========== LIGHTBOX - TOMBOL DI BAWAH (JUSTIFY) ========== */
.csl-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

/* Container konten lightbox */
.csl-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Gambar di lightbox */
.csl-lightbox-img {
    max-width: 90%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

/* Tombol close (kanan atas) */
.csl-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 45px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
}

.csl-close:hover {
    color: #ff4444;
    transform: rotate(90deg);
    background: rgba(0,0,0,0.8);
}

/* Caption di bawah gambar */
.csl-caption {
    color: white;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 30px;
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

/* Container tombol navigasi - JUSTIFY (merata kiri-kanan) */
.csl-lightbox-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 500px;
    margin-top: 25px;
    gap: 20px;
}

/* Tombol prev dan next - style sama, tapi posisi justify */
.csl-lightbox-prev,
.csl-lightbox-next {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 24px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 40px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Icon panah pada tombol */
.csl-lightbox-prev::before {
    content: "◀";
    margin-right: 5px;
    font-size: 14px;
}

.csl-lightbox-next::after {
    content: "▶";
    margin-left: 5px;
    font-size: 14px;
}

.csl-lightbox-prev:hover,
.csl-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.6);
}

.csl-lightbox-prev:active,
.csl-lightbox-next:active {
    transform: scale(0.98);
}

/* Indikator halaman di tengah */
.csl-lightbox-counter {
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    border-radius: 30px;
    font-family: monospace;
    letter-spacing: 1px;
    font-weight: bold;
}

/* ========== RESPONSIVE (MOBILE) ========== */
@media (max-width: 768px) {
    /* Slider responsive */
    .csl-slide-img {
        height: 250px;
    }
    
    .csl-prev, 
    .csl-next {
        padding: 8px 14px;
        font-size: 18px;
    }
    
    .csl-dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    
    /* Lightbox responsive */
    .csl-lightbox-img {
        max-height: 60vh;
        max-width: 95%;
    }
    
    .csl-lightbox-nav {
        width: 95%;
        max-width: 350px;
        gap: 10px;
        margin-top: 15px;
    }
    
    .csl-lightbox-prev,
    .csl-lightbox-next {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .csl-lightbox-prev::before {
        content: "◀";
        font-size: 11px;
    }
    
    .csl-lightbox-next::after {
        content: "▶";
        font-size: 11px;
    }
    
    .csl-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
        width: 40px;
        height: 40px;
    }
    
    .csl-caption {
        font-size: 12px;
        max-width: 90%;
        padding: 6px 15px;
        margin-top: 10px;
    }
    
    .csl-lightbox-counter {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ========== TABLET ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .csl-slide-img {
        height: 350px;
    }
    
    .csl-lightbox-nav {
        max-width: 400px;
    }
    
    .csl-lightbox-prev,
    .csl-lightbox-next {
        padding: 9px 18px;
        font-size: 14px;
    }
}

/* ========== DESKTOP LARGE ========== */
@media (min-width: 1440px) {
    .csl-slide-img {
        height: 500px;
    }
    
    .csl-lightbox-content {
        max-width: 1400px;
    }
    
    .csl-lightbox-img {
        max-height: 75vh;
    }
}

/* ========== ANIMASI & EFEK TAMBAHAN ========== */
/* Loading effect */
.csl-slide-img.loading {
    opacity: 0.5;
    filter: blur(5px);
}

/* Smooth transition untuk lightbox */
.csl-lightbox {
    animation: lightboxFadeIn 0.2s ease-out;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

/* Efek zoom saat hover pada gambar slider */
.csl-slide-img {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Indikator loading untuk lightbox */
.csl-lightbox-img {
    transition: opacity 0.3s ease;
}

.csl-lightbox-img.loading {
    opacity: 0.5;
}

/* Tombol disable (jika hanya 1 gambar) */
.csl-lightbox-prev:disabled,
.csl-lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar custom (opsional) */
.csl-lightbox::-webkit-scrollbar {
    width: 8px;
}

.csl-lightbox::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}

.csl-lightbox::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.csl-lightbox::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}