/**
 * استایل کامنت‌ها با Badge متخصص و خطوط اتصال 90 درجه
 * @package Iran Doctor Online
 */

/* ═══════════════════════════════════════════════════════════════
   1. Reset و تنظیمات پایه
   ═══════════════════════════════════════════════════════════════ */

.ast-comment-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.ast-comment-list li.comment {
    margin-bottom: 20px;
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   2. طراحی کارت کامنت
   ═══════════════════════════════════════════════════════════════ */

.comment-body {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.comment-body:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════════
   3. هدر کامنت (نویسنده + تاریخ)
   ═══════════════════════════════════════════════════════════════ */

.comment-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f7fafc;
}

/* بخش نویسنده */
.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-author .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #edf2f7;
    margin: 0 !important;
    transition: transform 0.3s ease;
}

.comment-body:hover .comment-author .avatar {
    border-color: #3182ce;
}

.comment-author cite {
    font-style: normal;
    font-weight: 700;
    color: #2d3748;
    font-size: 1rem;
}

.comment-author .says {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   4. Badge متخصص
   ═══════════════════════════════════════════════════════════════ */

.doctor-badge {
    background-color: #ebf8ff;
    color: #3182ce;
    border: 1px solid #bee3f8;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 8px;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   5. متا (تاریخ و ویرایش)
   ═══════════════════════════════════════════════════════════════ */

.comment-meta-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-metadata {
    font-size: 0.8rem;
    color: #a0aec0;
}

.comment-metadata a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s;
}

.comment-metadata a:hover {
    color: #718096;
}

.edit-link a {
    font-size: 0.75rem;
    color: #e53e3e;
    background: #fff5f5;
    padding: 2px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.edit-link a:hover {
    background: #e53e3e;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   6. محتوای کامنت
   ═══════════════════════════════════════════════════════════════ */

.comment-content {
    color: #4a5568;
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.comment-content p {
    margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   7. دکمه پاسخ
   ═══════════════════════════════════════════════════════════════ */

.reply {
    text-align: left;
    margin-top: 5px;
}

.reply a {
    display: inline-block;
    padding: 6px 18px;
    color: #4a5568;
    background-color: #edf2f7;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.2s;
}

.reply a:hover {
    background-color: #3182ce;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(49, 130, 206, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   8. کامنت‌های تو در تو با خطوط اتصال 90 درجه
   ═══════════════════════════════════════════════════════════════ */

.children {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    position: relative;
}

.children > li {
    padding-right: 50px;
    margin-top: 15px;
    position: relative;
}

/* خط عمودی (ساقه) */
.children > li::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: 0;
    right: 24px;
    width: 2px;
    background-color: #cbd5e0;
    z-index: 1;
}

/* خط افقی (آرنج) */
.children > li::after {
    content: '';
    position: absolute;
    top: 45px;
    right: 24px;
    width: 26px;
    height: 2px;
    background-color: #cbd5e0;
    z-index: 1;
}

/* آخرین فرزند */
.children > li:last-child::before {
    bottom: auto;
    height: 67px;
    border-bottom-right-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   9. پیغام انتظار تایید
   ═══════════════════════════════════════════════════════════════ */

.moderation-notice {
    background: #fff3cd;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment-awaiting-moderation {
    color: #856404;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   10. Responsive - موبایل
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .comment-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .comment-meta-group {
        width: 100%;
        justify-content: space-between;
    }
    
    /* کاهش فاصله در موبایل */
    .children > li {
        padding-right: 20px;
    }
    
    .children > li::before {
        right: 8px;
    }
    
    .children > li::after {
        right: 8px;
        width: 12px;
    }
}