/* Before After Elementor Frontend Styles */

.before-after-widget {
    width: 100%;
    margin: 0 auto;
}

.before-after-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

.before-after-container {
    position: relative !important;
    width: 100% !important;
    height: 400px !important;
    max-height: 400px !important;
    overflow: hidden !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: col-resize;
    user-select: none;
    display: block !important;
}

.before-after-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.before-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 400px !important;
    object-fit: cover !important;
    display: block !important;
    z-index: 1 !important;
}

.after-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 400px !important;
    object-fit: cover !important;
    display: block !important;
    z-index: 2 !important;
    /* After image on top, will be clipped by JavaScript */
}

.after-image-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 400px !important;
    overflow: hidden !important;
    /* Full container size - clipping handled by JavaScript */
}

.slider-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: #ffffff;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: none;
    z-index: 20;
}

.slider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-left-arrow,
.slider-right-arrow {
    width: 0;
    height: 0;
    margin: 0 2px;
}

.slider-left-arrow {
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #333;
}

.slider-right-arrow {
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #333;
}

.before-label,
.after-label {
    position: absolute;
    top: 20px;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
}

.before-label {
    left: 20px;
}

.after-label {
    right: 20px;
}

/* Gallery styles for multiple comparisons */
.before-after-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 20px 0;
}

.before-after-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-title,
.before-after-title {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: block;
}

.before-after-title {
    margin-bottom: 20px;
    font-size: 24px;
}

.comparison-description {
    margin-top: 15px;
    color: #666;
    line-height: 1.6;
}

/* Social Sharing Styles */
.social-sharing-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.sharing-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    margin-right: 8px;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-share-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Platform-specific colors */
.social-facebook { background-color: #1877f2; }
.social-twitter { background-color: #1da1f2; }
.social-linkedin { background-color: #0077b5; }
.social-pinterest { background-color: #bd081c; }
.social-whatsapp { background-color: #25d366; }
.social-instagram { background-color: #e4405f; }
.social-email { background-color: #666666; }

.social-facebook:hover { background-color: #166fe5; }
.social-twitter:hover { background-color: #1a91da; }
.social-linkedin:hover { background-color: #006397; }
.social-pinterest:hover { background-color: #a0071a; }
.social-whatsapp:hover { background-color: #22c35e; }
.social-instagram:hover { background-color: #d62d51; }
.social-email:hover { background-color: #555555; }

/* Overlay positioning */
.social-sharing-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 15;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 8px;
}

.social-sharing-overlay .social-sharing-buttons {
    margin: 0;
    gap: 8px;
}

.social-sharing-overlay .sharing-label {
    display: none;
}

.social-sharing-overlay .social-share-btn {
    width: 32px;
    height: 32px;
}

.social-sharing-overlay .social-share-btn svg {
    width: 16px;
    height: 16px;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 10000;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive styles */
@media (max-width: 768px) {
    .before-after-container {
        height: 300px;
    }
    
    .slider-handle {
        width: 35px;
        height: 35px;
    }
    
    .before-label,
    .after-label {
        top: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .before-label {
        left: 15px;
    }
    
    .after-label {
        right: 15px;
    }
    
    .before-after-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .before-after-container {
        height: 250px;
    }
    
    .slider-handle {
        width: 30px;
        height: 30px;
    }
    
    .slider-left-arrow {
        border-right: 6px solid #333;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
    }
    
    .slider-right-arrow {
        border-left: 6px solid #333;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
    }
}

/* Animation for smooth transitions */
.before-after-container * {
    transition: all 0.1s ease-out;
}

/* Loading state */
.before-after-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background-color: #f0f0f0;
    color: #666;
    font-size: 16px;
}

/* Error state */
.before-after-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background-color: #f8f8f8;
    color: #999;
    font-size: 14px;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

/* Property detail page styles */
.property-before-after-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.property-section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.property-comparison {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.property-comparison .comparison-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

.property-comparison .comparison-description {
    margin-top: 15px;
}

.property-comparison .comparison-description p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Responsive adjustments for property display */
@media (max-width: 768px) {
    .property-before-after-section {
        margin: 20px 0;
        padding: 15px;
    }
    
    .property-section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .property-comparison {
        padding: 15px;
    }
    
    .property-comparison .before-after-container {
        height: 300px !important;
        max-height: 300px !important;
    }
    
    .property-comparison .before-image,
    .property-comparison .after-image {
        max-height: 300px !important;
    }
    
    .property-comparison .after-image-container {
        max-height: 300px !important;
    }
}

/* WordPress theme override styles */
.houzez-property .before-after-container,
.property-detail .before-after-container,
.property-content .before-after-container {
    height: 400px !important;
    max-height: 400px !important;
    overflow: hidden !important;
}

.houzez-property .before-image,
.houzez-property .after-image,
.property-detail .before-image,
.property-detail .after-image,
.property-content .before-image,
.property-content .after-image {
    max-height: 400px !important;
    height: 100% !important;
}

/* Additional height constraint fixes */
.before-after-widget img {
    max-height: 400px !important;
}

/* Loading state styles */
.before-after-container.loading {
    opacity: 0.7;
}

.before-after-container.loading::before {
    content: "Loading images...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    font-size: 14px;
}

/* Debug styles (disabled by default) */
.before-after-container.show-debug .after-image-container {
    border: 2px solid red !important;
    background: rgba(255, 0, 0, 0.1) !important;
}

.before-after-container.show-debug .after-image {
    border: 2px solid blue !important;
}

/* Ensure container is interactive */
.before-after-container {
    cursor: col-resize;
    user-select: none;
}

.before-after-container.dragging {
    cursor: col-resize !important;
}

@media (max-width: 768px) {
    .houzez-property .before-after-container,
    .property-detail .before-after-container, 
    .property-content .before-after-container {
        height: 300px !important;
        max-height: 300px !important;
    }
    
    .houzez-property .before-image,
    .houzez-property .after-image,
    .property-detail .before-image,
    .property-detail .after-image,
    .property-content .before-image,
    .property-content .after-image {
        max-height: 300px !important;
    }
    
    .before-after-widget img {
        max-height: 300px !important;
    }
}

@media (max-width: 480px) {
    .houzez-property .before-after-container,
    .property-detail .before-after-container,
    .property-content .before-after-container {
        height: 250px !important;
        max-height: 250px !important;
    }
    
    .houzez-property .before-image,
    .houzez-property .after-image,
    .property-detail .before-image,
    .property-detail .after-image,  
    .property-content .before-image,
    .property-content .after-image {
        max-height: 250px !important;
    }
    
    .before-after-widget img {
        max-height: 250px !important;
    }
}