﻿/* ===== تنسيقات أساسية ===== */
* {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --main-font: 'Tajawal', sans-serif;
    --primary-color: #007bff;
    --secondary-color: #0056b3;
}

body {
    font-family: var(--main-font);
    direction: rtl;
}

/* ===== تنسيقات سلايدر التقييمات الحديث ===== */
.reviews-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
}

.reviews-slider-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
}

/* قسم إضافة التقييم */
.add-review-section {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.add-review-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

    .add-review-card:hover {
        box-shadow: 0 15px 40px rgba(0,0,0,0.15);
        transform: translateY(-5px);
    }

    .add-review-card.guest-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

.add-review-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
}

.add-review-card.guest-card .add-review-header {
    background: rgba(255,255,255,0.1);
}

.add-review-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
}

/* تحسين وضوح النص تحت العنوان */
.add-review-header .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.add-review-body {
    padding: 2rem;
}

/* ===== نظام النجوم المحسن - الحل النهائي ===== */
.rating-stars-large {
    display: flex;
    justify-content: center;
    gap: 8px;
    direction: rtl;
    margin: 1rem 0;
}

.star-label-large {
    cursor: pointer;
    font-size: 2.5rem;
    color: #ddd;
    transition: all 0.2s ease;
    position: relative;
}

    .star-label-large i {
        transition: all 0.2s ease;
    }

/* تأثير الهوفر - يعمل فقط عندما لا يكون هناك اختيار */
.rating-stars-large:not(.has-selection) .star-label-large:hover {
    color: #ffc107 !important;
}

    .rating-stars-large:not(.has-selection) .star-label-large:hover ~ .star-label-large {
        color: #ddd !important;
    }

/* النجوم المختارة - ثابتة ولا تتأثر بالهوفر */
.rating-stars-large.has-selection .star-label-large {
    color: #ffc107 !important;
}

    /* حالة خاصة: عندما يكون هناك اختيار، نتجاهل الهوفر تماماً */
    .rating-stars-large.has-selection .star-label-large:hover,
    .rating-stars-large.has-selection .star-label-large:hover ~ .star-label-large {
        color: #ffc107 !important; /* يبقى ذهبياً */
    }

/* نظام النجوم في المودال - نفس التحسينات */
.rating-stars {
    direction: rtl;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.star-label {
    cursor: pointer;
    font-size: 1.8rem;
    color: #ddd;
    transition: all 0.2s ease;
}

    .star-label i {
        transition: all 0.2s ease;
    }

/* تأثير الهوفر للمودال - يعمل فقط عندما لا يكون هناك اختيار */
.rating-stars:not(.has-selection) .star-label:hover {
    color: #ffc107 !important;
}

    .rating-stars:not(.has-selection) .star-label:hover ~ .star-label {
        color: #ddd !important;
    }

/* النجوم المختارة في المودال - ثابتة */
.rating-stars.has-selection .star-label {
    color: #ffc107 !important;
}

    .rating-stars.has-selection .star-label:hover,
    .rating-stars.has-selection .star-label:hover ~ .star-label {
        color: #ffc107 !important;
    }

/* تأثير الاهتزاز للتحذير */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.rating-error {
    animation: shake 0.5s ease-in-out;
}

/* ===== تنسيقات Swiper ===== */
.reviews-slider-wrapper {
    overflow: hidden;
    border-radius: 20px;
    position: relative;
}

.swiper {
    width: 100%;
    height: 100%;
    padding: 10px 0;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* أزرار التنقل لـ Swiper */
.swiper-button-next,
.swiper-button-prev {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    margin-top: -30px;
}

    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 18px;
    }

    .swiper-button-next:hover,
    .swiper-button-prev:hover {
        background: var(--primary-color);
        color: white;
        transform: scale(1.1);
    }

/* ===== تصميم بطاقات التقييمات ===== */
.review-slide-card {
    width: 100%;
    max-width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 280px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.review-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-left: 0.75rem;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(0,123,255,0.3);
}

.reviewer-info {
    flex: 1;
}

.reviewer-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    text-align: right;
}

.review-date {
    color: #6c757d;
    font-size: 0.8rem;
    text-align: right;
}

.review-rating {
    direction: ltr;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

    .review-rating .rating-stars {
        display: flex;
        gap: 2px;
    }

        .review-rating .rating-stars i {
            font-size: 1.1rem;
            color: #ffc107;
        }

/* ===== تحسينات النصوص العربية ===== */
.review-comment-container {
    flex: 1;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.review-comment {
    color: #555;
    line-height: 1.7;
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
    text-align: right;
    direction: rtl;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: justify;
    transition: all 0.4s ease-in-out;
    flex: 1;
}

/* زر التوسيع/التقلص */
.expand-toggle {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.35rem 0.7rem;
    margin-top: 0.3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    border-radius: 18px;
    align-self: flex-end;
    font-weight: 500;
}

    .expand-toggle:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }

/* النصوص القابلة للتوسيع */
.review-comment.expandable {
    max-height: 5.6em;
    overflow: hidden;
    position: relative;
}

    .review-comment.expandable::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        left: 0;
        height: 40px;
        background: linear-gradient(to bottom, transparent 0%, white 90%);
        pointer-events: none;
        border-radius: 0 0 15px 15px;
        transition: opacity 0.3s ease;
    }

.review-comment.expanded {
    max-height: 1000px;
    overflow: visible;
}

    .review-comment.expanded::after {
        opacity: 0;
        visibility: hidden;
    }

/* أزرار التعديل والحذف */
.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.btn-review-action {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    flex: 1;
}

/* ===== قسم الإحصائيات ===== */
.rating-stats-section {
    margin-bottom: 3rem;
}

.rating-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.stats-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.google-review-btn {
    background: white;
    color: #4285f4;
    border: 2px solid white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .google-review-btn:hover {
        background: transparent;
        color: white;
        border-color: white;
        transform: translateY(-2px);
    }

/* ===== قسم تقييمات المنصات ===== */
.platforms-section {
    margin-top: 4rem;
    padding: 3rem 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.platforms-title {
    text-align: center;
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

.platform-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

    .platform-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .platform-card:hover::before {
        transform: scaleX(1);
    }

    .platform-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
        border-color: var(--primary-color);
    }

.platform-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.platform-facebook .platform-icon {
    color: #1877f2;
}

.platform-google .platform-icon {
    color: #4285f4;
}

.platform-linkedin .platform-icon {
    color: #0077b5;
}

.platform-name {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.platform-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid;
}

.platform-facebook .platform-btn {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.platform-google .platform-btn {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.platform-linkedin .platform-btn {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.platform-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ===== وسائط الاستجابة الموحدة ===== */
@media (max-width: 1200px) {
    .review-slide-card {
        max-width: 300px;
    }
}

@media (max-width: 992px) {
    .reviews-slider-container {
        padding: 0 50px;
    }

    .review-slide-card {
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .reviews-slider-container {
        padding: 0 30px;
    }

    .review-slide-card {
        max-width: 240px;
        padding: 1.25rem;
        min-height: 260px;
    }

    /* تحسين النجوم للشاشات الصغيرة */
    .rating-stars-large {
        gap: 5px;
    }

    .star-label-large {
        font-size: 2rem;
    }

    .star-label {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .reviews-slider-container {
        padding: 0 15px;
    }

    .review-slide-card {
        max-width: 220px;
        padding: 1rem;
        min-height: 250px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .reviews-section {
        padding: 2rem 0;
    }

    .stats-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .platforms-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}

/* تصميم العنصر النائب عند عدم وجود تقييمات */
.no-reviews-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

    .no-reviews-placeholder i {
        margin-bottom: 1rem;
    }

/* تحسينات إضافية للنماذج */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0
