/* ==========================================================================
   استایل‌های بهینه‌شده بخش نظرات - نسخه مدرن و مینیمال
   ========================================================================== */

/* ============================================
   محفظه اصلی نظرات
   ============================================ */
.comments-area {
    margin: 40px 0 30px;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 30px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

/* ============================================
   عنوان نظرات
   ============================================ */
.comments-title {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: #1a1a2e;
    border-bottom: 3px solid #3498db;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to left, #e0e0e0, transparent);
}

.comments-title .comment-number {
    background: #3498db;
    color: #fff;
    padding: 2px 14px;
    border-radius: 30px;
    font-size: 0.65em;
    font-weight: 600;
    margin-right: 8px;
}

/* ============================================
   لیست نظرات
   ============================================ */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

/* ============================================
   هر نظر
   ============================================ */
.comment-list > li.comment {
    background: #f8fafc;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 12px;
    border-right: 4px solid #3498db;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.comment-list > li.comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.03), transparent);
    pointer-events: none;
}

.comment-list > li.comment:hover {
    background: #f0f4f8;
    transform: translateX(-4px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.08);
    border-right-color: #2980b9;
}

/* ============================================
   بدنه نظر
   ============================================ */
.comment-body {
    padding: 0;
    position: relative;
    z-index: 1;
}

/* ============================================
   اطلاعات نویسنده
   ============================================ */
.comment-author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comment-author .avatar,
.comment-author .custom-avatar {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    object-fit: cover;
    width: 55px;
    height: 55px;
}

.comment-author .avatar:hover,
.comment-author .custom-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.2);
}

.comment-author .fn {
    font-weight: 700;
    color: #1a1a2e;
    font-style: normal;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

.comment-author .fn a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author .fn a:hover {
    color: #3498db;
}

.comment-author .says {
    display: none;
}

/* ============================================
   تاریخ و زمان
   ============================================ */
.comment-metadata {
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: #95a5a6;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-metadata a {
    color: #95a5a6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-metadata a:hover {
    color: #3498db;
    text-decoration: underline;
}

.comment-metadata .edit-link {
    margin-right: 5px;
}

.comment-metadata .edit-link a {
    color: #3498db;
    font-size: 0.9em;
}

.comment-metadata .edit-link a:hover {
    color: #2980b9;
}

/* ============================================
   پیام انتظار تایید
   ============================================ */
.comment-awaiting-moderation {
    color: #e67e22;
    background: #fef9e7;
    padding: 4px 16px;
    border-radius: 30px;
    display: inline-block;
    margin: 8px 0 12px 0;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    font-weight: 500;
    border: 1px solid #fae5d3;
}

/* ============================================
   متن نظر
   ============================================ */
.comment-content {
    color: #2d3436;
    line-height: 1.9;
    margin: 12px 0 8px;
    padding: 0 5px;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
}

.comment-content p {
    margin: 12px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content ul,
.comment-content ol {
    margin: 12px 0;
    padding-right: 25px;
}

.comment-content ul li,
.comment-content ol li {
    margin-bottom: 5px;
}

.comment-content blockquote {
    border-right: 4px solid #3498db;
    padding: 10px 20px;
    margin: 15px 0;
    background: #f8fafc;
    border-radius: 8px;
    font-style: italic;
    color: #555;
}

.comment-content code {
    background: #f1f3f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e74c3c;
}

/* ============================================
   دکمه پاسخ
   ============================================ */
.reply {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    padding: 6px 22px;
    border-radius: 30px;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.comment-reply-link::before {
    content: '↩';
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.comment-reply-link:hover {
    background: #3498db;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
}

.comment-reply-link:hover::before {
    transform: rotate(-90deg);
}

/* ============================================
   نظرات تودرتو (پاسخ‌ها)
   ============================================ */
.children {
    list-style: none;
    padding-right: 30px;
    margin-top: 20px;
    border-right: 3px solid #dfe6e9;
}

.children .comment {
    background: #f8fafc;
    padding: 20px;
    margin-bottom: 18px;
    border-radius: 10px;
    border-right: 4px solid #2ecc71;
}

.children .children {
    border-right-color: #f39c12;
}

.children .children .children {
    border-right-color: #9b59b6;
}

.children .children .children .children {
    border-right-color: #e74c3c;
}

/* ============================================
   نظر نویسنده پست
   ============================================ */
.bypostauthor > .comment-body {
    background: #fef9e7;
    border-right-color: #f39c12;
}

.bypostauthor .fn {
    color: #e67e22;
}

.bypostauthor .fn::after {
    content: 'نویسنده';
    font-size: 0.6em;
    background: #f39c12;
    color: #fff;
    padding: 2px 12px;
    border-radius: 30px;
    margin-right: 10px;
    font-weight: 500;
}

/* ============================================
   نظر کاربر ثبت‌نام شده
   ============================================ */
.comment-author-admin .comment-body {
    background: #eaf4fb;
    border-right-color: #2980b9;
}

/* ============================================
   بخش خالی بودن نظرات
   ============================================ */
.no-comments {
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    color: #7f8c8d;
    text-align: center;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    border: 2px dashed #dfe6e9;
}

/* ============================================
   Pagination نظرات
   ============================================ */
.comment-navigation {
    margin: 30px 0;
}

.comment-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.comment-navigation .nav-previous a,
.comment-navigation .nav-next a {
    color: #3498db;
    text-decoration: none;
    padding: 10px 25px;
    border: 2px solid #3498db;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
}

.comment-navigation .nav-previous a:hover,
.comment-navigation .nav-next a:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
}

/* ============================================
   دکمه لغو پاسخ
   ============================================ */
#cancel-comment-reply-link {
    color: #e74c3c;
    text-decoration: none;
    font-size: clamp(0.75rem, 0.85vw, 0.85rem);
    padding: 4px 16px;
    border: 2px solid #e74c3c;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
}

#cancel-comment-reply-link:hover {
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    transform: scale(1.05);
}

/* ============================================
   استایل فرم نظر
   ============================================ */
.comment-respond {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 3px solid #ecf0f1;
}

.comment-reply-title {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: #1a1a2e;
    margin-bottom: 25px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-reply-title small {
    font-size: 0.6em;
    margin-right: 10px;
}

.comment-reply-title small a {
    color: #e74c3c;
    text-decoration: none;
}

.comment-reply-title small a:hover {
    text-decoration: underline;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
}

.comment-form .required {
    color: #e74c3c;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e8eaed;
    border-radius: 10px;
    font-family: inherit;
    font-size: clamp(0.9rem, 1vw, 1rem);
    transition: all 0.3s ease;
    background: #fafbfc;
    color: #2d3436;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.08);
    background: #ffffff;
}

.comment-form textarea {
    min-height: 160px;
    resize: vertical;
}

.comment-form .form-submit {
    margin-top: 10px;
}

.comment-form input[type="submit"] {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    padding: 14px 45px;
    border-radius: 10px;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.comment-form input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.3);
}

.comment-form input[type="submit"]:active {
    transform: scale(0.97);
}

/* فیلدهای نام، ایمیل و وبسایت در دسکتاپ */
@media (min-width: 768px) {
    .comment-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .comment-form-author {
        grid-column: 1;
    }
    
    .comment-form-email {
        grid-column: 2;
    }
    
    .comment-form-url {
        grid-column: 1 / -1;
    }
    
    .comment-form textarea {
        grid-column: 1 / -1;
    }
    
    .comment-form .form-submit {
        grid-column: 1 / -1;
    }
}

/* استایل کوکی */
.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 5px 0;
    grid-column: 1 / -1;
}

.comment-form-cookies-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3498db;
    flex-shrink: 0;
}

.comment-form-cookies-consent label {
    font-weight: 400;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: #555;
    margin: 0;
}

/* پیام‌های راهنما */
.comment-notes,
.logged-in-as {
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: #7f8c8d;
    margin-bottom: 10px;
}

.logged-in-as a {
    color: #3498db;
    text-decoration: none;
}

.logged-in-as a:hover {
    text-decoration: underline;
}

/* ============================================
   عکس پروفایل کاربر در فرم نظر
   ============================================ */
.comment-form-user-avatar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e8eaed;
    margin-bottom: 5px;
}

.comment-form-user-avatar .user-comment-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid #3498db;
    object-fit: cover;
}

.comment-form-user-avatar .user-comment-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: clamp(0.9rem, 1vw, 1rem);
}

/* ============================================
   ریسپانسیو موبایل - بهینه‌شده
   ============================================ */
@media (max-width: 768px) {
    .comments-area {
        padding: 15px;
        margin: 15px 0;
        border-radius: 12px;
    }
    
    .comments-title {
        font-size: clamp(1.1rem, 4vw, 1.3rem);
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    
    .comments-title .comment-number {
        font-size: 0.6em;
        padding: 1px 10px;
    }
    
    .comment-list > li.comment {
        padding: 16px;
        margin-bottom: 15px;
        border-radius: 10px;
        border-right-width: 3px;
    }
    
    .comment-list > li.comment:hover {
        transform: translateX(-2px);
    }
    
    .comment-author {
        gap: 10px;
    }
    
    .comment-author .avatar,
    .comment-author .custom-avatar {
        width: 42px !important;
        height: 42px !important;
        border-width: 2px;
    }
    
    .comment-author .fn {
        font-size: clamp(0.85rem, 3.5vw, 0.95rem);
    }
    
    .comment-metadata {
        font-size: clamp(0.6rem, 2.5vw, 0.7rem);
        margin-bottom: 8px;
    }
    
    .comment-content {
        font-size: clamp(0.85rem, 3.5vw, 0.95rem);
        line-height: 1.8;
        padding: 0 3px;
    }
    
    .comment-content ul,
    .comment-content ol {
        padding-right: 18px;
    }
    
    .comment-content blockquote {
        padding: 8px 15px;
        margin: 10px 0;
    }
    
    .reply {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .comment-reply-link {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 8px 15px;
        font-size: clamp(0.7rem, 3vw, 0.8rem);
    }
    
    .children {
        padding-right: 15px;
        border-right-width: 2px;
    }
    
    .children .comment {
        padding: 14px;
        margin-bottom: 12px;
        border-right-width: 3px;
    }
    
    .bypostauthor .fn::after {
        font-size: 0.5em;
        padding: 1px 10px;
        margin-right: 6px;
    }
    
    .comment-navigation .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .comment-navigation .nav-previous a,
    .comment-navigation .nav-next a {
        text-align: center;
        justify-content: center;
        padding: 8px 15px;
        font-size: clamp(0.7rem, 3vw, 0.8rem);
    }
    
    .comment-respond {
        margin-top: 25px;
        padding-top: 20px;
    }
    
    .comment-reply-title {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 18px;
    }
    
    .comment-form {
        gap: 14px;
        grid-template-columns: 1fr !important;
    }
    
    .comment-form label {
        font-size: clamp(0.8rem, 3.5vw, 0.9rem);
        margin-bottom: 4px;
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        padding: 10px 14px;
        font-size: clamp(0.85rem, 4vw, 1rem) !important;
        border-radius: 8px;
    }
    
    .comment-form textarea {
        min-height: 120px;
    }
    
    .comment-form input[type="submit"] {
        width: 100%;
        padding: 12px 20px;
        font-size: clamp(0.85rem, 4vw, 0.95rem);
    }
    
    .comment-form-cookies-consent {
        gap: 8px;
    }
    
    .comment-form-cookies-consent label {
        font-size: clamp(0.7rem, 3vw, 0.8rem);
    }
    
    .comment-form-user-avatar {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .comment-form-user-avatar .user-comment-avatar {
        width: 38px;
        height: 38px;
    }
    
    .comment-form-user-avatar .user-comment-name {
        font-size: clamp(0.8rem, 3.5vw, 0.9rem);
    }
    
    .no-comments {
        padding: 20px;
        font-size: clamp(0.85rem, 3.5vw, 0.95rem);
    }
    
    #cancel-comment-reply-link {
        font-size: clamp(0.65rem, 2.5vw, 0.75rem);
        padding: 3px 12px;
    }
}

/* ============================================
   ریسپانسیو برای موبایل‌های بسیار کوچک
   ============================================ */
@media (max-width: 480px) {
    .comments-area {
        padding: 10px;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .comment-list > li.comment {
        padding: 12px;
        border-radius: 8px;
    }
    
    .comment-author .avatar,
    .comment-author .custom-avatar {
        width: 35px !important;
        height: 35px !important;
    }
    
    .comment-author .fn {
        font-size: clamp(0.8rem, 4vw, 0.85rem);
    }
    
    .comment-content {
        font-size: clamp(0.8rem, 4vw, 0.85rem);
        line-height: 1.7;
    }
    
    .children {
        padding-right: 10px;
    }
    
    .children .comment {
        padding: 10px;
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        padding: 8px 12px;
        font-size: clamp(0.8rem, 4.5vw, 0.9rem) !important;
    }
    
    .comment-form textarea {
        min-height: 100px;
    }
}

/* ============================================
   دکمه‌های زیبا برای موبایل
   ============================================ */
@media (max-width: 768px) {
    .comment-form input[type="submit"] {
        border-radius: 8px;
        font-size: clamp(0.8rem, 4vw, 0.9rem);
    }
    
    .comment-reply-link {
        border-radius: 20px;
        font-size: clamp(0.65rem, 3vw, 0.75rem);
        padding: 6px 12px;
    }
}

/* ============================================
   انیمیشن‌های ورود
   ============================================ */
@keyframes commentSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-list > li.comment {
    animation: commentSlideIn 0.4s ease-out forwards;
}

.comment-list > li.comment:nth-child(2) {
    animation-delay: 0.1s;
}

.comment-list > li.comment:nth-child(3) {
    animation-delay: 0.2s;
}

.comment-list > li.comment:nth-child(4) {
    animation-delay: 0.3s;
}

.comment-list > li.comment:nth-child(5) {
    animation-delay: 0.4s;
}

/* ============================================
   اسکرول‌بار زیبا برای مرورگرها
   ============================================ */
.comments-area ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.comments-area ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.comments-area ::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 10px;
}

.comments-area ::-webkit-scrollbar-thumb:hover {
    background: #a0a8b0;
}