/**
 * Before After Comparison Styles
 * Side-by-side layout with hover expansion
 */

/* Container */
.ba-slider-container {
    width: 100%;
}

/* Comparison - Side by Side Layout */
.ba-comparison {
    display: flex;
    width: 100%;
    height: 450px;
    overflow: hidden;
    gap: 4px;
}

.ba-comparison-item {
    position: relative;
    flex: 1;
    overflow: hidden;
    transition: flex 0.4s ease;
}

.ba-comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Labels */
.ba-comparison-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background-color: rgba(107, 95, 85, 0.85);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ba-comparison-label[data-position="top"] {
    top: 16px;
    bottom: auto;
}

.ba-comparison-label[data-position="center"] {
    top: 50%;
    transform: translate(-50%, -50%);
}

.ba-comparison-label[data-position="bottom"] {
    bottom: 16px;
    top: auto;
}

/* ==========================================================================
   Carousel
   ========================================================================== */

.ba-carousel {
    position: relative;
    width: 100%;
}

.ba-carousel-track {
    position: relative;
    overflow: hidden;
}

.ba-carousel-slide {
    display: none;
    width: 100%;
}

.ba-carousel-slide.active {
    display: block;
}

/* Slide animations */
.ba-carousel-slide.slide-in-left {
    animation: slideInLeft 0.4s ease both;
}

.ba-carousel-slide.slide-in-right {
    animation: slideInRight 0.4s ease both;
}

.ba-carousel-slide.slide-out-left {
    animation: slideOutLeft 0.4s ease both;
}

.ba-carousel-slide.slide-out-right {
    animation: slideOutRight 0.4s ease both;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Navigation */
.ba-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.ba-carousel-nav svg {
    width: 24px;
    height: 24px;
    stroke: #333;
}

.ba-carousel-nav:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Arrow Styles */
.ba-carousel-nav.ba-nav-circle {
    border-radius: 50%;
}

.ba-carousel-nav.ba-nav-square {
    border-radius: 8px;
}

.ba-carousel-nav.ba-nav-minimal {
    background: transparent;
    border: none;
}

.ba-carousel-nav.ba-nav-minimal:hover {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

/* Arrow Positions */
.ba-nav-outside .ba-carousel-prev {
    left: -70px;
}

.ba-nav-outside .ba-carousel-next {
    right: -70px;
}

.ba-nav-inside .ba-carousel-prev {
    left: 16px;
}

.ba-nav-inside .ba-carousel-next {
    right: 16px;
}

/* Dots */
.ba-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.ba-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.ba-carousel-dot:hover,
.ba-carousel-dot.active {
    background: #333;
    transform: scale(1.2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .ba-nav-outside .ba-carousel-prev {
        left: -60px;
    }
    
    .ba-nav-outside .ba-carousel-next {
        right: -60px;
    }
}

@media (max-width: 991px) {
    .ba-nav-outside .ba-carousel-prev {
        left: 10px;
    }
    
    .ba-nav-outside .ba-carousel-next {
        right: 10px;
    }
    
    .ba-carousel-nav {
        background: rgba(255, 255, 255, 0.9);
    }
}

@media (max-width: 767px) {
    .ba-comparison {
        height: 300px;
    }
    
    .ba-carousel-nav {
        width: 40px;
        height: 40px;
    }
    
    .ba-carousel-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .ba-comparison-label {
        font-size: 12px;
        padding: 6px 12px;
    }
}
