/**
 * Nexus Comments - Frontend Stylesheet
 * Version: 1.0.0
 * این فایل ظاهر کلی سیستم دیدگاه‌ها، واکنش‌گرایی و انیمیشن‌ها را تعریف می‌کند.
 */

/* --- بخش ۱: متغیرها و استایل‌های پایه --- */
.nexus-comments-wrapper,
.nexus-form-wrapper {
    /* این متغیر توسط کنترل‌های رنگ المنتور تنظیم می‌شود و در کل فایل قابل استفاده است */
    --nexus-primary-color: #6750A4;
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    width: 100%;
}

.nexus-comments-wrapper *,
.nexus-form-wrapper * {
    box-sizing: border-box;
}

/* --- بخش ۲: ویجت لیست دیدگاه‌ها (Nexus Comments List) --- */

.nexus-comments-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #333;
}

/* نگهدارنده کارت هر دیدگاه (برای مدیریت margin و ساختار تو در تو) */
.nexus-comment-card-container {
    list-style: none; /* برای حذف دایره‌های li */
    padding: 0;
    margin: 0;
    margin-bottom: 16px;
}

/* ساختار دیدگاه‌های تو در تو (پاسخ‌ها) */
.nexus-comment-card-container .children {
    margin-right: 30px;
    margin-top: 16px;
    padding-right: 20px;
    border-right: 2px solid #e0e0e0;
}

/* استایل اصلی کارت دیدگاه */
.nexus-comment-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background-color: #f8f8f8; /* این رنگ توسط کنترل المنتور قابل تغییر است */
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* انیمیشن نرم برای سایه */
}

.nexus-comment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nexus-comment-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.nexus-comment-main {
    flex-grow: 1;
}

.nexus-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.nexus-comment-author-name {
    font-weight: 600;
}

.nexus-comment-date {
    font-size: 0.875rem;
}

.nexus-comment-content {
    line-height: 1.6;
    margin-bottom: 12px;
}
.nexus-comment-content p {
    margin: 0;
}

/* دکمه پاسخ */
.nexus-comment-actions .comment-reply-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: none;
    border-radius: 99px; /* شکل کپسولی */
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden; /* ضروری برای افکت ریپل */
    -webkit-tap-highlight-color: transparent;

    color: var(--nexus-primary-color);
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.nexus-comment-actions .comment-reply-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* --- بخش ۳: ویجت فرم ارسال دیدگاه (Nexus Comments Form) --- */

.nexus-form-wrapper .comment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* تغییر چیدمان فیلدهای نام، ایمیل و... */
.nexus-form-wrapper .comment-form-author,
.nexus-form-wrapper .comment-form-email,
.nexus-form-wrapper .comment-form-url {
    display: flex;
    flex-direction: column;
}
.nexus-form-wrapper .comment-form label {
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: #555;
}
.nexus-form-wrapper .comment-form input,
.nexus-form-wrapper .comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* انیمیشن فوکوس متریال */
.nexus-form-wrapper .comment-form input:focus,
.nexus-form-wrapper .comment-form textarea:focus {
    outline: none;
    border-color: var(--nexus-primary-color);
    box-shadow: 0 0 0 2px rgba(var(--nexus-primary-color-rgb, 103, 80, 164), 0.2); /* نیاز به JS برای تبدیل hex به rgb دارد */
}
/* اگر نخواهیم از JS استفاده کنیم، میتوانیم سایه را حذف کنیم */
.nexus-form-wrapper .comment-form input:focus,
.nexus-form-wrapper .comment-form textarea:focus {
    outline: none;
    border: 2px solid var(--nexus-primary-color);
    padding: 11px 15px; /* برای جبران ضخامت بوردر */
}

/* دکمه ارسال */
.nexus-form-wrapper .form-submit .submit {
    padding: 12px 32px;
    border-radius: 99px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    background-color: var(--nexus-primary-color);
    color: #fff;
    position: relative; /* برای افکت ریپل */
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.nexus-form-wrapper .form-submit .submit:hover {
    filter: brightness(1.1);
}
.nexus-form-wrapper .form-submit .submit:active {
    transform: scale(0.98);
}

/* --- بخش ۴: انیمیشن ریپل (Ripple Effect) --- */
.nexus-ripple {
    position: absolute;
    border-radius: 50%;
    /* رنگ ریپل را از رنگ متن یا پس‌زمینه دکمه می‌گیرد */
    background-color: currentColor;
    opacity: 0.2;
    transform: scale(0);
    animation: nexus-ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes nexus-ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* --- بخش ۵: واکنش‌گرایی (Responsive Design) --- */

/* برای تبلت و نمایشگرهای کوچکتر */
@media (max-width: 768px) {
    .nexus-comment-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .nexus-comment-main {
        width: 100%;
    }

    /* کاهش فاصله در پاسخ‌های تو در تو */
    .nexus-comment-card-container .children {
        margin-right: 15px;
        padding-right: 15px;
    }
}

/* برای موبایل */
@media (max-width: 480px) {
    .nexus-comments-title {
        font-size: 1.25rem;
    }

    .nexus-comment-avatar img {
        width: 40px;
        height: 40px;
    }

    .nexus-comment-card, .nexus-form-wrapper .comment-form-fields {
        padding: 12px;
    }

    .nexus-form-wrapper .comment-form-fields {
        flex-direction: column;
    }
}