/* Spectra Image Slider - Frontend Styles */

.sis-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    max-height: 600px; /* Prevent excessive height */
}

.sis-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    max-height: 500px; /* Control wrapper height */
}

/* Peek mode specific styling */
.sis-slider-container[data-peek-percentage]:not([data-peek-percentage="0"]) {
    overflow: visible; /* Allow peek images to show outside container */
}

.sis-slider-container[data-peek-percentage]:not([data-peek-percentage="0"]) .sis-slider-wrapper {
    overflow: visible; /* Allow peek images to show outside wrapper */
}

/* Add subtle opacity to peek images for better visual hierarchy */
.sis-slider-container[data-peek-percentage]:not([data-peek-percentage="0"]) .sis-slide {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.sis-slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    gap: 15px;
}

.sis-slide {
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 0 0 auto; /* Don't grow or shrink */
    /* Width will be set dynamically by JavaScript */
}

.sis-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.sis-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.sis-slide img:hover {
    transform: scale(1.05);
}

/* Navigation Arrows */
.sis-arrow {
	color: white !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(215, 160, 42, 0.8);
    border: none;
    width: 44px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* .sis-arrow:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
} */

/* .sis-arrow:active {
    transform: translateY(-50%) scale(0.95);
} */

.sis-arrow-prev {
    left: 15px;
}

.sis-arrow-next {
    right: 15px;
}

.sis-arrow svg {
    width: 24px;
    height: 24px;
}

/* Navigation Dots */
.sis-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    margin-top: 10px;
}

.sis-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.sis-dot:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

.sis-dot.active {
    opacity: 1;
    transform: scale(1.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sis-slider-container[data-columns="6"] .sis-slide {
        width: calc((100% - 45px) / 4); /* 4 columns */
    }
    
    .sis-slide {
        height: 220px;
    }
}

@media (max-width: 992px) {
    .sis-slider-container[data-columns="5"] .sis-slide,
    .sis-slider-container[data-columns="6"] .sis-slide {
        width: calc((100% - 30px) / 3); /* 3 columns */
    }
    
    .sis-slide {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .sis-slider-track {
        gap: 10px;
    }
    
    .sis-slider-container[data-columns="3"] .sis-slide,
    .sis-slider-container[data-columns="4"] .sis-slide,
    .sis-slider-container[data-columns="5"] .sis-slide,
    .sis-slider-container[data-columns="6"] .sis-slide {
        width: calc((100% - 10px) / 2); /* 2 columns */
    }
    
    .sis-slide {
        height: 180px;
        min-width: 150px;
    }
    
    /* Mobile peek mode specific styling */
    .sis-slider-container[data-mobile-peek-percentage]:not([data-mobile-peek-percentage="0"]) {
        overflow: visible; /* Allow peek images to show outside container on mobile */
    }
    
    .sis-slider-container[data-mobile-peek-percentage]:not([data-mobile-peek-percentage="0"]) .sis-slider-wrapper {
        overflow: visible; /* Allow peek images to show outside wrapper on mobile */
    }
    
    .sis-slider-container {
        max-height: 400px;
    }
    
    .sis-slider-wrapper {
        max-height: 300px;
    }
    
    .sis-arrow {
        width: 36px;
        height: 36px;
    }
    
    .sis-arrow svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .sis-slider-track {
        gap: 8px;
        padding: 10px;
    }
    
    .sis-slider-container .sis-slider-track {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .sis-arrow {
        width: 32px;
        height: 32px;
    }
    
    .sis-arrow svg {
        width: 18px;
        height: 18px;
    }
    
    .sis-dots {
        padding: 15px;
    }
    
    .sis-dot {
        width: 10px;
        height: 10px;
    }
}

/* Loading State */
.sis-slider-container.loading .sis-slide {
    opacity: 0.5;
}

.sis-slider-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: sis-spin 1s linear infinite;
    z-index: 100;
}

@keyframes sis-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Lightbox Integration */
.sis-slide img {
    cursor: zoom-in;
}

/* Lightbox Styles */
.sis-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.sis-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.sis-lightbox-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80vw; /* Can be larger now that arrows are outside */
    max-height: 85vh;
    text-align: center;
}

.sis-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.sis-lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.sis-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000;
    z-index: 10001;
}

/* .sis-lightbox-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
} */

.sis-lightbox-prev {
    left: 50px; /* Fixed distance from left edge */
}

.sis-lightbox-next {
    right: 50px; /* Fixed distance from right edge */
}

.sis-lightbox-nav svg {
    width: 28px;
    height: 28px;
}

.sis-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sis-lightbox-caption {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    text-align: center;
    padding: 0 20px;
    line-height: 1.4;
}

.sis-lightbox-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

/* Lightbox responsive */
@media (max-width: 768px) {
    .sis-lightbox-container {
        max-width: 85vw; /* Larger on tablets now */
        max-height: 85vh;
    }
    
    .sis-lightbox-close {
        top: -35px;
        font-size: 30px;
        width: 35px;
        height: 35px;
    }
    
    .sis-lightbox-nav {
        width: 50px;
        height: 50px;
    }
    
    .sis-lightbox-prev {
        left: 20px; /* Adjust for tablet */
    }
    
    .sis-lightbox-next {
        right: 20px; /* Adjust for tablet */
    }
    
    .sis-lightbox-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .sis-lightbox-image {
        max-height: 75vh;
    }
    
    .sis-lightbox-caption {
        font-size: 14px;
        margin-top: 10px;
    }
    
    .sis-lightbox-counter {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sis-lightbox-container {
        max-width: 90vw; /* Even larger on mobile */
        max-height: 75vh;
    }
    
    .sis-lightbox-nav {
        width: 45px;
        height: 45px;
    }
    
    .sis-lightbox-prev {
        left: 10px; /* Close to edge on mobile */
    }
    
    .sis-lightbox-next {
        right: 10px; /* Close to edge on mobile */
    }
    
    .sis-lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .sis-lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 24px;
        width: 32px;
        height: 32px;
    }
    
    .sis-lightbox-image {
        max-height: 65vh;
    }
}

/* Accessibility */
.sis-arrow:focus,
.sis-dot:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* RTL Support */
[dir="rtl"] .sis-arrow-prev {
    right: 15px;
    left: auto;
}

[dir="rtl"] .sis-arrow-next {
    left: 15px;
    right: auto;
}
