/**
 * Before/After Image Slider Styles
 * Modern, responsive design matching Roomzio theme
 */

/* Main section wrapper */
.property-before-after-section {
    margin: 40px 0;
    padding: 0;
}

.property-before-after-section .section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #2c3e50;
    position: relative;
    padding-bottom: 15px;
}

.property-before-after-section .section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Tabs navigation */
.ba-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #ecf0f1;
    flex-wrap: wrap;
}

.ba-tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #7f8c8d;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: -2px;
}

.ba-tab-btn:hover {
    color: #2c3e50;
    background: rgba(236, 240, 241, 0.3);
}

.ba-tab-btn.active {
    color: #ffffff;
    background: #000000;
    border-bottom-color: #000000;
    border-radius: 4px 4px 0 0;
}

/* Tab content */
.ba-tab-content {
    display: none;
}

.ba-tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Before/After container */
.before-after-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: ew-resize;
    background: #f8f9fa;
}

.before-after-container:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

/* Image wrapper */
.ba-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
}

/* Images */
.ba-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

.ba-image-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.ba-image-after {
    z-index: 1;
}

/* Labels */
.ba-label {
    position: absolute;
    bottom: 15px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    border-radius: 3px;
    backdrop-filter: blur(10px);
}

.ba-label-before {
    left: 15px;
}

.ba-label-after {
    right: 15px;
}

/* Slider line and handle */
.ba-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    z-index: 4;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    cursor: ew-resize;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ba-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ba-handle:before,
.ba-handle:after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.ba-handle:before {
    left: 8px;
    border-width: 8px 12px 8px 0;
    border-color: transparent #e74c3c transparent transparent;
}

.ba-handle:after {
    right: 8px;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #e74c3c;
}

/* Dragging state */
.ba-dragging {
    cursor: ew-resize;
}

.ba-dragging .ba-handle {
    transform: translate(-50%, -50%) scale(1.15);
}

/* Single comparison (no tabs) */
.ba-single-comparison {
    margin-top: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .property-before-after-section .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .ba-tabs-nav {
        gap: 5px;
    }

    .ba-tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .ba-label {
        display: none;
    }

    .ba-label-before {
        display: none;
    }

    .ba-label-after {
        display: none;
    }

    .ba-handle {
        width: 40px;
        height: 40px;
    }

    .ba-handle:before {
        left: 6px;
        border-width: 6px 10px 6px 0;
    }

    .ba-handle:after {
        right: 6px;
        border-width: 6px 0 6px 10px;
    }
}

@media (max-width: 480px) {
    .property-before-after-section {
        margin: 30px 0;
    }

    .ba-tabs-nav {
        flex-direction: column;
        gap: 0;
    }

    .ba-tab-btn {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #ecf0f1;
        border-left: 3px solid transparent;
        margin-bottom: 0;
    }

    .ba-tab-btn.active {
        border-bottom-color: #ecf0f1;
        border-left-color: #e74c3c;
    }

    .before-after-container {
        border-radius: 4px;
    }
}

/* Loading state */
.ba-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
