/* ===== استایل‌های اصلی ===== */

/* فرم ثبت نظر */
.ccs-form-wrapper {
    display: flex;
    align-content: flex-end;
    justify-content: space-between;
    border-radius: 12px;
    margin-bottom: 80px;
    gap: 16px;
    flex-wrap: wrap;
}

.ccs-name-email-wrapper,
.ccs-textarea-wrapper,
.ccs-rating-submit-wrapper {
    width: 30%;
    min-width: 250px;
    display: flex;
    gap: 8px;
    flex-direction: column;
    justify-content: space-between;
}

/* امتیاز */
.ccs-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ccs-rating-label {
    font-size: 14px;
    color: #1E3D58;
    font-weight: 700;
    font-size: 14px;
}

.ccs-stars-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ccs-stars {
    display: flex;
    gap: 4px;
}

.ccs-stars .star {
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ccs-stars .star svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s;
}

.ccs-stars .star svg path {
    transition: fill 0.2s, fill-opacity 0.2s;
}

/* ردیف نام و ایمیل */
.ccs-row {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ccs-input-wrapper {
    gap: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    height: 100px;
}

.ccs-textarea-wrapper{height: 190px;}

.ccs-visually-hidden {
    color: rgba(30, 61, 88, 1);
    font-weight: 700;
    font-size: 14px;
}

.ccs-icon {
    position: absolute;
    right: 12px;
    top: 38px;
    transform: translateY(0);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.ccs-icon svg {
    width: 20px;
    height: 20px;
}

.ccs-input-wrapper input {
    border: 1px solid rgba(170, 215, 255, 1);
    border-radius: 16px;
    width: 100%;
    height: 48px;
    padding: 0 40px 0 40px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.ccs-input-wrapper input:focus {
    border-color: #B87333;
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.ccs-input-wrapper input::placeholder {
    color: #999;
    font-size: 14px;
}

/* متن نظر */
.ccs-textarea-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ccs-textarea-wrapper textarea {
    border: 1px solid rgba(170, 215, 255, 1);
    border-radius: 16px;
    width: 100%;
    padding: 16px;
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s;
    height: 100%;
    min-height: 120px;
    box-sizing: border-box;
}

.ccs-textarea-wrapper textarea:focus {
    border-color: #B87333;
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.ccs-textarea-wrapper textarea::placeholder {
    color: #999;
    font-size: 14px;
}

/* دکمه ثبت نظر با استایل جدید */
.ccs-submit-btn {
    position: relative !important;
    overflow: hidden !important;
    background-color: #1E3D58 !important;
    color: #e8e8e8 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    border-radius: 16px !important;
    width: 150px !important;
    height: 40px !important;
    border: none !important;
    text-transform: uppercase !important;
    box-shadow: 0 10px 20px rgba(51, 51, 51, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
}

.ccs-submit-btn .elementor-button-text {
    position: relative !important;
    z-index: 2 !important;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

.ccs-submit-btn::before {
    height: 40px;
    content: " ثبت نظر" !important;
    position: absolute !important;
    inset: 0 !important;
    background: #DA8F49 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    transform: translateY(90%) !important;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

.ccs-submit-btn::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background-color: #333 !important;
    transform: translateY(-100%) !important;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1) !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

.ccs-submit-btn:hover::before {
    transform: translateY(0) !important;
}

.ccs-submit-btn:hover::after {
    transform: translateY(-200%) !important;
}

.ccs-submit-btn:hover .elementor-button-text {
    transform: translateY(-120%) !important;
    opacity: 0 !important;
}

.ccs-submit-btn:focus {
    outline: none !important;
}

.ccs-submit-btn:active {
    transform: scale(0.95) !important;
}

.ccs-rating-submit-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 32px;
}

.ccs-rating-section {
    gap: 16px;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
}

/* ===== استایل خطاها ===== */
.ccs-error-message {
    color: #dc3545;
    font-size: 12px;
    display: none;
    font-weight: 400;
    min-height: 18px;
    /* added min-height to prevent layout shift */
}

.ccs-field-error input,
.ccs-field-error textarea,
.ccs-field-error .ccs-stars {
    border-color: #dc3545 !important;
}

.ccs-field-error input:focus,
.ccs-field-error textarea:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.ccs-rating-section {
    height: 90px;
}

/* ===== نظرات ===== */

.comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comments-list>li {
    background: rgba(255, 255, 255, 0.5);
    padding-bottom: 32px;
    box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 64px;
    margin: 0px 8px 48px 8px;
    list-style: none;
}

.ccs-comment-wrapper {
    overflow: hidden;
}

/* هدر نظر */
.ccs-comment-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(233, 233, 233, 1);
    flex-wrap: wrap;
    gap: 10px;
}

.ccs-comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ccs-comment-author strong {
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.ccs-comment-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #888;
    align-items: flex-end;
    flex-direction: row;
}

/* نمایش امتیاز عددی جدید */
.ccs-rating-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    position: relative;
    /* برای مدیریت بهتر جداکننده */
}

.ccs-rating-value {
    color: #B87333;
    font-size: 13px;
    line-height: 1;
}

.ccs-rating-display svg {
    width: 14px;
    height: 14px;
}

.ccs-rating-display svg path {
    fill: #B87333;
}

/* تاریخ */
.ccs-comment-date {
    position: relative;
}

/* جداکننده بعد از ccs-rating-display */
.ccs-rating-display::after {
    content: "•";
    position: absolute;
    left: -8px;
    /* فاصله از المان */
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
    font-size: 14px;
}

/* اطمینان از عدم تداخل با المان‌های دیگر */
.ccs-rating-display:last-child::after {
    display: none;
    /* اگر آخرین المان بود جداکننده نداشته باشه */
}

/* متن نظر */
.ccs-comment-content {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
}

.ccs-comment-content p {
    margin: 0 0 12px 0;
}

.ccs-comment-content p:last-child {
    margin-bottom: 0;
}

/* پاسخ‌ها */
.children {
    list-style: none;
    padding-right: 0;
    margin-right: 0;
}

.children .ccs-comment-wrapper {
    background: rgba(245, 245, 245, 0.5);
    box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.1);
    margin: 32px 80px 0px 80px;
    border-radius: 8px;
}

/* صفحه‌بندی */
.comments-pagination {
    margin-top: 40px;
    text-align: center;
}

.comments-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #ddd;
}

.comments-pagination .page-numbers.current {
    background: #B87333;
    color: #fff;
    border-color: #B87333;
}

.comments-pagination .page-numbers:hover:not(.current) {
    background: #f5f5f5;
    border-color: #B87333;
}

/* بدون نظر */
.no-comments {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 12px;
    color: #666;
    font-size: 15px;
}

/* حالت موبایل */
@media (max-width: 768px) {
    .ccs-comment-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ccs-comment-meta {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===== پاپ‌آپ موفقیت (مشابه کد دوم) ===== */
.ccs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: ccsFadeIn 0.3s ease;
}

.ccs-modal {
    background: white;
    border-radius: 24px;
    max-width: 400px;
    width: 90%;
    padding: 40px 24px 24px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: ccsSlideUp 0.4s ease;
}

.ccs-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.ccs-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.ccs-modal-icon {
    margin-bottom: 24px;
}

.ccs-modal-icon svg {
    width: 64px;
    height: 64px;
}

.ccs-modal-icon svg circle {
    stroke: #88B04B;
}

.ccs-modal-icon svg path {
    stroke: #88B04B;
}

.ccs-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ccs-modal-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

.ccs-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.ccs-modal-ok {
    background: #B87333;
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.ccs-modal-ok:hover {
    background: #9e5f2a;
    transform: translateY(-1px);
}

@keyframes ccsFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ccsSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* حالت موبایل */
@media (max-width: 992px) {
    .ccs-rating-submit-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 32px;
    align-content: flex-end;
    align-items: flex-end;
}

    .ccs-name-email-wrapper,
    .ccs-textarea-wrapper,
    .ccs-rating-submit-wrapper {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .ccs-row {
        grid-template-columns: 1fr;
    }

    .children .ccs-comment-wrapper {
        margin: 20px 20px 0px 20px;
    }

    .ccs-comment-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ccs-modal {
        width: 95%;
        padding: 30px 16px 20px;
    }

}
.comments-list>li {
    position: relative;
    overflow: hidden;
}

.comments-list>li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -50px;
    width: 272px;
    height: 360px;
    background-image: url('data:image/svg+xml;utf8,<svg width="272" height="360" viewBox="0 0 272 360" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(%23filter0_f_2202_1041)"><ellipse cx="29.5" cy="192" rx="42.5" ry="112" fill="%23AAD7FF"/></g><defs><filter id="filter0_f_2202_1041" x="-213" y="-120" width="485" height="624" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="100" result="effect1_foregroundBlur_2202_1041"/></filter></defs></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
    opacity: 1;
}
