/* Before-After Image Comparison Component */

.before-after-section {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafa 0%, #ffffff 100%);
}

/* Section Introduction */
.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.before-after-section h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.section-description {
    font-size: 1.125rem;
    color: #406463;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Comparison Gallery */
.comparison-gallery {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.treatment-showcase {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comparison-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    cursor: ew-resize;
    touch-action: none;
    background: #f8f9fa;
}

.comparison-container img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.before-image {
    position: relative;
    z-index: 1;
}

.after-image {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    /* The key to the fluid reveal */
    clip-path: inset(0 0 0 var(--reveal-position, 50%));
    transition: clip-path 0.2s ease-out;
}

.slider-handle {
    --position: var(--reveal-position, 50%);
    position: absolute;
    top: 0;
    left: var(--position);
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: rgba(90, 125, 124, 0.6);
    z-index: 3;
    transition: left 0.2s ease-out;
}

.slider-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(90, 125, 124, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.slider-handle-circle:hover {
    background: rgba(90, 125, 124, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-handle-circle svg {
    color: #ffffff;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.comparison-label {
    position: absolute;
    top: 1.5rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background: rgba(44, 62, 80, 0.8);
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.comparison-label.before {
    left: 2rem;
}

.comparison-label.after {
    right: 2rem;
}

/* Hover effects */
.comparison-container:hover .comparison-label {
    opacity: 1;
}

.comparison-container:hover img {
    transform: scale(1.02);
    transition: transform 0.5s ease-out;
}

.comparison-container img {
    transition: transform 0.5s ease-out;
}

/* Treatment Description Styles */
.treatment-description {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.treatment-description h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.treatment-description p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.treatment-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.treatment-tag,
.duration-tag,
.result-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.treatment-tag {
    background: rgba(90, 125, 124, 0.1);
    color: #406463;
    border: 1px solid rgba(90, 125, 124, 0.2);
}

.duration-tag {
    background: rgba(44, 62, 80, 0.1);
    color: #2c3e50;
    border: 1px solid rgba(44, 62, 80, 0.2);
}

.result-tag {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

/* Enhanced CTA Section */
.section-cta {
    background: rgba(90, 125, 124, 0.05);
    border-radius: 2rem;
    padding: 3rem 2rem;
    margin-top: 4rem;
    text-align: center;
    border: 1px solid rgba(90, 125, 124, 0.1);
}

.cta-content h3 {
    font-size: 1.75rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.cta-content p {
    font-size: 1.125rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-button.primary {
    background: #406463;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid #406463;
}

.cta-button.primary:hover {
    background: #4a6a68;
    border-color: #4a6a68;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(90, 125, 124, 0.3);
}

.cta-button.secondary {
    background: transparent;
    color: #406463;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid #406463;
}

.cta-button.secondary:hover {
    background: #406463;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(90, 125, 124, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .before-after-section {
        padding: 3rem 1rem;
    }
    
    .before-after-section h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .section-intro {
        margin-bottom: 3rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .comparison-gallery {
        gap: 3rem;
    }
    
    .treatment-showcase {
        gap: 1.5rem;
    }
    
    .comparison-container {
        border-radius: 1rem;
        max-width: 100%;
    }
    
    .slider-handle-circle {
        width: 50px;
        height: 50px;
    }
    
    .slider-handle-circle svg {
        width: 24px;
        height: 24px;
    }
    
    .comparison-label {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        top: 1rem;
    }
    
    .comparison-label.before {
        left: 1rem;
    }
    
    .comparison-label.after {
        right: 1rem;
    }
    
    /* Treatment Description Mobile */
    .treatment-description h3 {
        font-size: 1.25rem;
    }
    
    .treatment-description p {
        font-size: 0.9rem;
    }
    
    .treatment-details {
        gap: 0.5rem;
    }
    
    .treatment-tag,
    .duration-tag,
    .result-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    /* CTA Mobile */
    .section-cta {
        padding: 2rem 1.5rem;
        margin-top: 3rem;
    }
    
    .cta-content h3 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .cta-button.primary,
    .cta-button.secondary {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

/* Accessibility improvements */
.comparison-container:focus-within {
    outline: 3px solid #406463;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .comparison-container img,
    .slider-handle-circle,
    .comparison-label {
        transition: none;
    }
    
    .after-image {
        transition: none;
    }
}