/* ========================================
   استایل‌های نظرات محصول و ستاره‌های تعاملی
   ======================================== */

/* خلاصه امتیازات */
.reviews-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.summary-loading {
    text-align: center;
    padding: 20px;
}

.summary-loading .spinner-border {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.reviews-summary-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.average-rating {
    text-align: center;
}

.rating-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.rating-stars {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
}

.rating-stars .star {
    font-size: 24px;
    color: #ffd700;
}

.rating-stars .star.filled {
    color: #ffd700;
}

.rating-count {
    font-size: 14px;
    opacity: 0.9;
}

/* فرم ثبت نظر */
.review-form-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.review-form-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.review-form-title svg {
    color: #667eea;
}

/* ستاره‌های تعاملی برای ثبت امتیاز */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.star-rating-input.is-invalid {
    background: #fee;
    border: 2px solid #dc3545;
}

.star-rating-input input[type="radio"] {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 32px;
    color: #cbd5e0;
    transition: all 0.2s ease;
    margin: 0;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input[type="radio"]:checked ~ label {
    color: #ffd700;
    transform: scale(1.1);
}

.rating-text-display {
    display: inline-block;
    margin-right: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    vertical-align: middle;
}

/* استایل‌های validation برای فیلدها */
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #28a745;
}

/* کپچا */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-image {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px;
    background: white;
    height: 60px;
}

/* لیست نظرات */
.reviews-list-new {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.review-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.review-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.review-body {
    flex: 1;
}

.review-header-new {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.reviewer-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reviewer-name {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.review-rating {
    display: flex;
    gap: 3px;
}

.review-rating .star {
    font-size: 16px;
    color: #cbd5e0;
}

.review-rating .star.filled {
    color: #ffd700;
}

.review-date-new {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #718096;
}

.review-date-new svg {
    color: #a0aec0;
}

.review-comment {
    color: #4a5568;
    line-height: 1.7;
}

.review-comment p {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* حالت خالی */
.no-reviews-new {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    margin-bottom: 20px;
}

.empty-state-icon svg {
    color: #cbd5e0;
}

.no-reviews-new h6 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.no-reviews-new p {
    color: #718096;
    font-size: 15px;
}

/* Responsive */
@@media (max-width: 768px) {
    .reviews-summary-card {
        padding: 20px;
    }

    .rating-number {
        font-size: 36px;
    }

    .rating-stars .star {
        font-size: 20px;
    }

    .review-form-card {
        padding: 20px;
    }

    .star-rating-input label {
        font-size: 28px;
    }

    .review-card {
        padding: 15px;
    }

    .review-header-new {
        flex-direction: column;
        gap: 10px;
    }

    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@@media (max-width: 480px) {
    .captcha-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .star-rating-input label {
        font-size: 24px;
    }
}

/* پیام موفقیت زیبا */
.review-success-alert {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    animation: slideInDown 0.5s ease;
}

.success-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.6s ease;
}

.success-icon svg {
    color: white;
}

.success-content {
    flex: 1;
}

.success-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
}

.success-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
}

/* پیام خطا زیبا */
.review-error-alert {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
    animation: slideInDown 0.5s ease;
}

.error-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: shake 0.6s ease;
}

.error-icon svg {
    color: white;
}

.error-content {
    flex: 1;
}

.error-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: white;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-list li {
    font-size: 14px;
    line-height: 1.7;
    padding: 8px 0;
    padding-right: 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.95);
}

.error-list li:before {
    content: "•";
    position: absolute;
    right: 0;
    font-size: 20px;
    line-height: 1;
}

/* Loading هنگام ثبت نظر */
.review-submit-loading {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid #e9ecef;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-content .spinner-border {
    width: 50px;
    height: 50px;
    border-width: 4px;
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin: 0;
}

/* انیمیشن‌ها */
@@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.review-card {
    animation: fadeIn 0.4s ease;
}

