﻿.blog-comment-form {
    direction: rtl;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media screen and (max-width: 640px) {
    .blog-comment-form {
        padding: 14px 10px 10px;
    }
}

.en .blog-comment-form {
    direction: ltr;
}

.blog-comments-form-title {
    display: flex;
    align-items: center;
}

.blog-comments-form-title h1,
.blog-comments-form-title h2,
.blog-comments-form-title h3,
.blog-comments-form-title h4,
.blog-comments-form-title h5,
.blog-comments-form-title h6 {
    font-size: 16px;
    font-weight: bold;
    margin: 0 10px;
    padding: 0 10px;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field {
    display: flex;
    flex-wrap: wrap;
    max-width: 50%;
    flex: 1;
    position: relative;
}

@media screen and (max-width: 992px) {
    .blog-comment-form-cont .blog-comment-row .blog-comment-field {
        width: 100%;
        max-width: 260px;
    }
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field select:focus + label,
.blog-comment-form-cont .blog-comment-row .blog-comment-field select:valid + label {
    top: -4px;
    font-size: 12px;
    color: #334155;
    background: white;
    padding: 0 4px;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field select:focus {
    border: 1px solid #0061bb;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field label {
    position: absolute;
    right: 12px;
    top: 22px;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    transition: 0.2s ease;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 15px;
    height: 44px;
    font-family: inherit;
    width: 100%;
    font-size: 13px;
    box-sizing: border-box;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input::-moz-placeholder {
    opacity: 0;
    -moz-transition: 0.2s ease;
    transition: 0.2s ease;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input::placeholder {
    opacity: 0;
    transition: 0.2s ease;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input:focus::-moz-placeholder {
    opacity: 1;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input:focus::placeholder {
    opacity: 1;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input:focus {
    border: 1px solid #0061bb;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field input:focus + label,
.blog-comment-form-cont .blog-comment-row .blog-comment-field input:not(:placeholder-shown) + label,
.blog-comment-form-cont .blog-comment-row .blog-comment-field input:-webkit-autofill + label {
    top: -4px;
    font-size: 12px;
    color: #334155;
    background: white;
    padding: 0 4px;
}

/* نام و ایمیل در یک سطر */
.blog-comment-form-cont .blog-comment-user-row {
    display: flex;
    flex-direction: row;
    margin-top: 20px;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
}

.blog-comment-form-cont .blog-comment-user-row .blog-comment-field {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 0;
}

.blog-comment-form-cont .blog-comment-user-row input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* textarea تمام عرض */
.blog-comment-form-cont .blog-comment-row:has(textarea) .blog-comment-field {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 15px 0;
    height: 180px;
    font-family: inherit;
    width: 100%;
    font-size: 13px;
    box-sizing: border-box;
    resize: vertical;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea::-moz-placeholder {
    opacity: 0;
    -moz-transition: 0.2s ease;
    transition: 0.2s ease;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea::placeholder {
    opacity: 0;
    transition: 0.2s ease;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea:focus::-moz-placeholder {
    opacity: 1;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea:focus::placeholder {
    opacity: 1;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea:focus {
    border: 1px solid #0061bb;
}

.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea:focus + label,
.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea:not(:placeholder-shown) + label,
.blog-comment-form-cont .blog-comment-row .blog-comment-field textarea:-webkit-autofill + label {
    top: -4px;
    font-size: 12px;
    color: #334155;
    background: white;
    padding: 0 4px;
}

/* اطلاعات پاسخ */
.blog-comment-reply-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -8px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background-color: #f5faff;
    border: 1px solid #e1efff;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
}

.blog-comment-reply-info strong {
    color: #334155;
}

.blog-comment-reply-info .blog-comment-cancel-btn {
    margin-right: auto;
}

@media screen and (max-width: 576px) {
    .blog-comment-form-cont .blog-comment-user-row {
        flex-direction: column;
    }

    .blog-comment-form-cont .blog-comment-user-row .blog-comment-field {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .blog-comment-reply-info {
        gap: 6px;
        padding: 8px;
        font-size: 12px;
    }
}

/* فرم پاسخ درون دیدگاه */
.blog-comment-inline-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.blog-comment-inline-form .blog-comment-form {
    padding: 14px;
    gap: 14px;
    background: #fcfdff;
    border-color: #e2e8f0;
}

/* فاصله مناسب فرم از مشخصات پاسخ */
.blog-comment-inline-form .blog-comment-reply-info {
    margin-top: 0;
    margin-bottom: 14px;
}

/* فاصله ردیف نام و ایمیل */
.blog-comment-inline-form .blog-comment-user-row {
    margin-top: 0;
}

/* ارتفاع مناسب کادر متن پاسخ */
.blog-comment-inline-form textarea {
    min-height: 120px;
    height: 140px;
}

@media screen and (max-width: 576px) {
    .blog-comment-inline-form {
        margin-top: 14px;
        padding-top: 12px;
    }

    .blog-comment-inline-form .blog-comment-form {
        padding: 12px 10px;
    }
}

.blog-comment-submit {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
}

@media screen and (max-width: 576px) {
    .blog-comment-submit {
        padding-top: 12px;
        gap: 0.8rem;
        flex-direction: column;
    }
}

.en .blog-comment-submit {
    direction: ltr;
}

.blog-comment-submit-btn {
    min-width: 120px;
    background-color: #0074dd;
    color: #fff;
    padding: 0 20px;
    font-family: inherit;
    line-height: 40px;
    border-radius: 100px;
    border: 0;
    font-size: 14px;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    cursor: pointer;
    transition: background-color 0.2s ease-in;
}

@media screen and (max-width: 576px) {
    .blog-comment-submit-btn {
        border-radius: 8px;
        box-shadow: none;
    }
}

.blog-comment-submit-btn.loading {
    color: transparent;
    position: relative;
    cursor: default;
}

.blog-comment-submit-btn.loading::before {
    content: "";
    background: url(https://cdn.safarme.ir/files/cimg/loading-spin.svg) no-repeat center top;
    width: 32px;
    height: 32px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -16px 0 0 -16px;
}

.blog-comment-submit-btn.loading:hover {
    background-color: #0074dd;
}

.blog-comment-submit-btn:hover {
    background-color: #0061bb;
}

/* لیست دیدگاه‌ها */
.blog-comments-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

/* دیدگاه اصلی */
.blog-comments-list > .blog-comment {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.035);
    min-width: 0;
}

/* نام نویسنده و تاریخ */
.blog-comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.blog-comment-header strong {
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.blog-comment-header span {
    color: #94a3b8;
    font-size: 12px;
}

/* متن دیدگاه */
.blog-comment-content {
    color: #475569;
    font-size: 14px;
    line-height: 2;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* پاسخ‌های هر دیدگاه */
.blog-comment-reply-item {
    margin-top: 14px;
    margin-right: 18px;
    padding: 14px;
    border-right: 3px solid #dbeafe;
    border-radius: 0 8px 8px 0;
    background: #f8fafc;
    min-width: 0;
}

.blog-comment-reply-item .blog-comment-header {
    margin-bottom: 8px;
}

/* حالت بدون دیدگاه */
.blog-comments-empty {
    margin-top: 20px;
    padding: 30px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    line-height: 2;
    text-align: center;
}

@media screen and (max-width: 576px) {
    .blog-comments-list {
        gap: 12px;
    }

    .blog-comments-list > .blog-comment {
        padding: 14px 12px;
        border-radius: 10px;
    }

    .blog-comment-reply-item {
        margin-right: 8px;
        padding: 11px;
    }

    .blog-comment-content {
        font-size: 13px;
    }

    .blog-comments-empty {
        padding: 22px 12px;
    }
}

.blog-comment-reply-btn {
    min-width: auto;
    margin-top: 12px;
    padding: 0 14px;
    background-color: #eff6ff;
    color: #2563eb;
    font-family: inherit;
    line-height: 30px;
    border-radius: 7px;
    border: 1px solid #dbeafe;
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media screen and (max-width: 576px) {
    .blog-comment-reply-btn {
        border-radius: 7px;
        box-shadow: none;
    }
}

.blog-comment-reply-btn:hover {
    background-color: #dbeafe;
    border-color: #bfdbfe;
}

.blog-comment-reply-btn.loading {
    color: transparent;
    position: relative;
    cursor: default;
}

.blog-comment-reply-btn.loading::before {
    content: "";
    background: url(https://cdn.safarme.ir/files/cimg/loading-spin.svg) no-repeat center top;
    width: 32px;
    height: 32px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -16px 0 0 -16px;
}

.blog-comment-reply-btn.loading:hover {
    background-color: #eff6ff;
}

.blog-comment-cancel-btn {
    background-color: #fff;
    padding: 0 10px;
    font-family: inherit;
    line-height: 30px;
    border-radius: 100px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    font-size: 14px;
    min-width: 80px;
}

@media screen and (max-width: 576px) {
    .blog-comment-cancel-btn {
        border-radius: 8px;
    }
}

.blog-comment-cancel-btn:hover {
    background-color: #f5f8fe;
}

.blog-comment-cancel-btn.loading {
    color: transparent;
    position: relative;
    cursor: default;
}

.blog-comment-cancel-btn.loading::before {
    content: "";
    background: url(https://cdn.safarme.ir/files/cimg/loading-spinblue.svg) no-repeat center top;
    width: 32px;
    height: 32px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -16px 0 0 -16px;
}

.blog-comment-cancel-btn.loading:hover {
    background-color: #fff;
}

.blog-comment-error {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
    margin: 6px 0 0;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.8;
    text-align: right;
}
