/**
 * أنماط قسم قبل وبعد - نسخة عصرية جديدة
 */

/* قسم قبل وبعد */
.before-after-section {
    padding: 80px 0;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
    clear: both;
}

/* خلفية القسم */
.before-after-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.03) 0%, rgba(var(--primary-color-rgb), 0.07) 100%);
    z-index: 0;
}

/* عنوان القسم */
.before-after-title {
    text-align: center !important;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.before-after-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center !important;
    direction: rtl !important;
    display: block !important;
    width: 100% !important;
}

.before-after-title p {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    text-align: center !important;
    direction: rtl !important;
    display: block !important;
    width: 100% !important;
}

.title-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    margin: 15px auto 20px;
    border-radius: 2px;
    position: relative;
}

/* إزالة الخط الطويل أسفل العنوان */
.title-line::after {
    display: none;
}

/* حاوية قبل وبعد */
.modern-before-after-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* سلايدر قبل وبعد */
.modern-before-after-slider {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-before-after-slider:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modern-before-after-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    cursor: ew-resize;
}

/* الصور */
.modern-before-image,
.modern-after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modern-before-image {
    z-index: 2;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

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

/* تسميات قبل وبعد */
.modern-before-label,
.modern-after-label {
    position: absolute;
    bottom: 20px;
    padding: 8px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    z-index: 3;
    transition: all 0.3s ease;
}

.modern-before-label {
    right: 20px;
}

.modern-after-label {
    left: 20px;
}

/* مقبض السلايدر */
.modern-slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: rgba(255, 255, 255, 0.7);
    cursor: ew-resize;
    z-index: 4;
}

.modern-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 2px solid #f0f0f0;
}

.modern-arrow-icon {
    color: var(--primary-color);
    font-size: 16px;
}

.modern-before-after-container.dragging .modern-handle-circle {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: #fff;
    border-color: var(--primary-color);
}

.modern-before-after-container.dragging .modern-arrow-icon {
    color: var(--primary-color);
}

/* أزرار التنقل */
.modern-before-after-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.modern-before-after-prev,
.modern-before-after-next {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
}

.modern-before-after-prev:hover,
.modern-before-after-next:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.4);
}

.modern-before-after-prev i,
.modern-before-after-next i {
    font-size: 18px;
}

/* مؤشرات السلايدر */
.modern-before-after-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.modern-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(var(--primary-color-rgb), 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-indicator.active {
    width: 14px;
    height: 14px;
    background-color: var(--primary-color);
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
    .modern-before-after-container {
        height: 400px;
    }

    .modern-handle-circle {
        width: 30px;
        height: 30px;
    }

    .modern-arrow-icon {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .modern-before-after-container {
        height: 300px;
    }

    .modern-before-label,
    .modern-after-label {
        padding: 3px 10px;
        font-size: 12px;
    }
}

/* الوضع الليلي */
body.dark-mode .before-after-section {
    background-color: #1a1a1a;
}

body.dark-mode .before-after-title h2 {
    color: #f0f0f0 !important;
}

body.dark-mode .before-after-title p {
    color: #ccc !important;
}

body.dark-mode .modern-before-label,
body.dark-mode .modern-after-label {
    background-color: rgba(40, 40, 40, 0.8);
    color: #f0f0f0;
}

body.dark-mode .modern-indicator {
    background-color: rgba(187, 134, 252, 0.3);
}

body.dark-mode .modern-indicator.active {
    background-color: #bb86fc;
}

body.dark-mode .modern-handle-circle {
    background-color: #bb86fc;
}

body.dark-mode .modern-before-after-prev,
body.dark-mode .modern-before-after-next {
    background-color: #bb86fc;
}
