/* =============================================
   Comments Section - Overlapping Header Design
   ============================================= */

.comments-section {
    max-width: 50vw;
    margin: 60px auto 40px;
    padding: 0 20px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    gap: 20px;
}

.comments-title {
    font-size: 20px;
    font-weight: 600;
    color: #0f4f59;
    margin: 0;
}

.submit-comment-btn {
    padding: 10px 32px;
    background: #e8f5f3;
    color: #0f4f59;
    border: 1px solid #0f4f59;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Comment Wrapper */
.comment-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Comment Box - ساختار با هدر روی متن */
.comment-box {
    position: relative;
    border-radius: 35px;
    overflow: visible;
    background: #fff;
    padding-top: 35px;
}

/* هدر کامنت - موقعیت مطلق */
.comment-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    padding: 15px 20px;
    border-radius: 16px;
    width: 92%;
    z-index: 2;
    margin: auto;
}

/* هدر ادمین - آبی تیره */
.admin-comment .comment-header {
    background: linear-gradient(135deg, #0a3d47 0%, #0f4f59 100%);
}

/* هدر کاربر - خاکستری روشن */
.user-comment .comment-header {
    background: #f5f5f5;
}

/* محتوای هدر ادمین */
.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-logo svg {
    width: 32px;
    height: 32px;
}

.admin-brand {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

/* محتوای هدر کاربر */
.user-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

/* تاریخ */
.comment-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.admin-comment .comment-date {
    color: rgba(255, 255, 255, 0.9);
}

.user-comment .comment-date {
    color: #666;
}

.comment-date svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* بدنه کامنت - با padding-top برای جای هدر */
.comment-body {
    background: #fff;
    padding: 50px 30px 20px 30px;
    border: 1px solid #d9d9d9;
    border-radius: 35px;
    position: relative;
    z-index: 1;
}

.comment-text {
    font-size: 15px;
    line-height: 2.2;
    color: #333;
    text-align: justify;
}



.comment-text p:last-child {
    margin-bottom: 0;
}

/* فوتر کامنت */
.comment-footer {
    display: flex;
    justify-content: flex-end;
}

/* دکمه پاسخ */
.reply-btn {
    background: transparent;
    color: #0f4f59;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* پاسخ‌ها - تورفتگی از راست */
/* پاسخ‌ها - تورفتگی از راست */
.comment-replies {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* هر پاسخ با آیکون */
.reply-item-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%; /* عرض کامل فضای موجود */
}

/* آیکون فلش - وسط‌چین با باکس متن */
.reply-arrow-icon {
    flex-shrink: 0;
    transform: rotate(90deg);
    align-self: center;
    width: 24px; /* عرض ثابت برای آیکون */
}

/* باکس پاسخ باید بقیه فضا را بگیرد */
.reply-item-wrapper .comment-box {
    flex: 1; /* استفاده از بقیه فضای موجود */
}


/* No Comments */
.no-comments {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 10px 30px;
}

.no-comments p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #0a3d47 0%, #0f4f59 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(15, 79, 89, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(15, 79, 89, 0.4);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Comment Form */
.comment-form .form-row,
.reply-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-form .form-group,
.reply-form .form-group {
    display: flex;
    flex-direction: column;
}

.comment-form input,
.comment-form textarea,
.reply-form input,
.reply-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    font-size: 14px;
    font-family: 'IRANSans', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
}

.comment-form input:focus,
.comment-form textarea:focus,
.reply-form input:focus,
.reply-form textarea:focus {
    outline: none;
    border-color: #0f4f59;
    background: #fff;
}

.comment-form textarea,
.reply-form textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.btn-submit {
    order: 2;
    padding: 12px 35px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0f4f59;
    color: #fff;
}

.btn-submit:hover {
    background: #0a3a42;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 79, 89, 0.3);
}

.anonymous-checkbox-label {
    order: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.anonymous-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #0f4f59;
}

/* Comment Notification */
.comment-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: #fff;
    padding: 18px 28px;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 14px;
    max-width: 380px;
    font-weight: 500;
}

.comment-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.comment-notification.success {
    border-right: 5px solid #28a745;
    color: #155724;
}

.comment-notification.error {
    border-right: 5px solid #dc3545;
    color: #721c24;
}

/* Reply Modal */
.reply-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reply-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.reply-modal-content {
    position: relative;
    background: #fff;
    border-radius: 25px;
    padding: 30px;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
    z-index: 100000;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reply-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.reply-modal-header h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: #0f4f59;
}

.reply-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 24px;
    line-height: 1;
}

.reply-modal-close:hover {
    color: #0f4f59;
    transform: rotate(90deg);
}

/* کارت بلاگ در مودال */
.modal-blog-card {
    display: flex;
    gap: 15px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.modal-blog-image {
    width: 100px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-blog-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-blog-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.6;
    display: flex;
    align-items: center;
}




/* هر پاسخ با آیکون */
.reply-item-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* آیکون فلش - وسط‌چین با باکس متن */
.reply-arrow-icon {
    flex-shrink: 0;
    transform: rotate(90deg);
    align-self: center;
}

