/* HE Simple Slider - Frontend Styles */

.he-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.he-slider {
    position: relative;
    overflow: hidden;
}

.he-slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    gap: var(--slider-gap, 20px);
}

.he-slider-slide {
    flex: 0 0 calc((100% - (var(--columns-mobile, 1) - 1) * var(--slider-gap, 20px)) / var(--columns-mobile, 1));
    min-width: 0;
}

@media (min-width: 768px) {
    .he-slider-slide {
        flex: 0 0 calc((100% - (var(--columns-tablet, 2) - 1) * var(--slider-gap, 20px)) / var(--columns-tablet, 2));
    }
}

@media (min-width: 1024px) {
    .he-slider-slide {
        flex: 0 0 calc((100% - (var(--columns-desktop, 4) - 1) * var(--slider-gap, 20px)) / var(--columns-desktop, 4));
    }
}

.he-slider-link {
    display: block;
    text-decoration: none;
}

.he-slider-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4/3;
    background: #f0f0f0;
}

.he-slider-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Hover Effects */
.he-slider-hover-zoom .he-slider-image-wrapper:hover img {
    transform: scale(1.08);
}

.he-slider-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.he-slider-hover-overlay .he-slider-image-wrapper:hover .he-slider-overlay,
.he-slider-hover-zoom-overlay .he-slider-image-wrapper:hover .he-slider-overlay {
    opacity: 1;
}

.he-slider-hover-zoom-overlay .he-slider-image-wrapper:hover img {
    transform: scale(1.08);
}

.he-slider-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    color: #333;
    margin-bottom: 12px;
}

.he-slider-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    max-width: 90%;
}

/* Navigation Arrows */
.he-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.he-slider-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.he-slider-arrow svg {
    width: 20px;
    height: 20px;
    stroke: #333;
}

.he-slider-prev {
    left: 15px;
}

.he-slider-next {
    right: 15px;
}

.he-slider-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.he-slider-arrow:disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* Navigation Dots */
.he-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.he-slider-dot {
    width: 10px;
    height: 10px;
    background: #ddd;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.he-slider-dot:hover {
    background: #bbb;
}

.he-slider-dot.active {
    background: #3b5fe5;
    transform: scale(1.2);
}

/* Touch/Drag States */
.he-slider.is-dragging .he-slider-track {
    transition: none;
}

.he-slider.is-dragging .he-slider-slide {
    cursor: grabbing;
}

/* Hide arrows on mobile if too cramped */
@media (max-width: 480px) {
    .he-slider-arrow {
        width: 36px;
        height: 36px;
    }
    
    .he-slider-arrow svg {
        width: 16px;
        height: 16px;
    }
    
    .he-slider-prev {
        left: 8px;
    }
    
    .he-slider-next {
        right: 8px;
    }
}

/* ========================================
   Lightbox Styles
   ======================================== */
.he-slider-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.he-slider-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.he-slider-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.he-slider-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.he-slider-lightbox.active .he-slider-lightbox-image {
    opacity: 1;
    transform: scale(1);
}

.he-slider-lightbox-title {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.he-slider-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.he-slider-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.he-slider-lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

.he-slider-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.he-slider-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.he-slider-lightbox-arrow svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

.he-slider-lightbox-prev {
    left: 20px;
}

.he-slider-lightbox-next {
    right: 20px;
}

.he-slider-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

/* Lightbox loading indicator */
.he-slider-lightbox-loading {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: he-slider-spin 0.8s linear infinite;
}

@keyframes he-slider-spin {
    to { transform: rotate(360deg); }
}

/* Clickable slide for lightbox */
.he-slider-slide[data-lightbox="true"] {
    cursor: pointer;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .he-slider-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .he-slider-lightbox-arrow {
        width: 40px;
        height: 40px;
    }
    
    .he-slider-lightbox-prev {
        left: 10px;
    }
    
    .he-slider-lightbox-next {
        right: 10px;
    }
    
    .he-slider-lightbox-title {
        bottom: -35px;
        font-size: 14px;
    }
}
