:root {
    /* Primary Colors */
    --acs-primary: #3b82f6;
    --acs-text: #334155;
    --acs-text-light: #64748b;
    --acs-border: #e2e8f0;
    --acs-bg-white: #ffffff;
    --acs-bg-gray: #f8fafc;
    
    /* Verified User Colors (Emerald) */
    --acs-verify-bg: #f9fffc;
    --acs-verify-border: #10b981;
    --acs-verify-text: #064e3b;
}

/* =========================================
   1. THEME CONFLICT RESET (High Priority)
   ========================================= */
/* Override specific theme selectors provided */
#comments .comment .comment-body, 
#comments .pingback .comment-body,
#comments .comment .acs-body-inner {
    display: block !important; /* Reset flex column from theme */
    padding: 10px !important; /* Reset huge paddings */
    margin: 0 !important;
    background: transparent !important;
}

/* Reset li styles that theme might add */
#comments li.comment, 
#comments li.acs-comment-item {
    border: none !important;
    padding: 0 !important;
    margin-bottom: 15px !important;
    background: transparent !important;
    list-style: none !important;
}

#comments ul, #comments ol {
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================
   2. PLUGIN STYLES
   ========================================= */

#comments.acs-comments-wrapper {
    margin: 0 auto;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    line-height: 1.6;
    color: var(--acs-text);
}

/* --- Form Styles --- */
#comments .acs-form-container {
    background: #fff;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid transparent; /* Fix spacing */
}

#comments .acs-form-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

#comments .acs-form-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

#comments .acs-note {
    font-size: 0.75rem;
    color: var(--acs-text-light);
}

#comments .acs-comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#comments .acs-input-group {
    display: flex;
    gap: 10px;
}

#comments .acs-comment-form input,
#comments .acs-comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--acs-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box; /* Important */
    margin: 0;
}

#comments .acs-comment-form textarea {
    min-height: 90px;
    resize: vertical;
}

#comments .acs-comment-form input:focus,
#comments .acs-comment-form textarea:focus {
    border-color: var(--acs-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

#comments .acs-form-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

#comments .acs-submit-btn {
    background: var(--acs-primary);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    line-height: normal;
}

#comments .acs-submit-btn:hover {
    background: #2dd4bf;
}

/* --- List Layout --- */
#comments .acs-list-header h3 {
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--acs-primary);
    display: inline-block;
    padding-bottom: 5px;
}

/* Indentation for replies */
#comments ul.children {
    margin-right: 25px !important;
    margin-top: 10px !important;
    position: relative;
    border: none !important;
    padding: 0 !important;
}

/* Guide Line */
#comments ul.children::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 0;
    bottom: 20px;
    width: 2px;
    background: #f1f5f9;
}

/* --- Comment Card Design --- */
/* We target our NEW class .acs-body-inner */
#comments .acs-body-inner {
    background: var(--acs-bg-white);
    border: 1px solid var(--acs-border);
    border-radius: 12px;
    padding: 16px !important; /* Force padding */
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

/* Style for Replies */
#comments .acs-body-inner.is-reply {
    background-color: var(--acs-bg-gray);
}

/* --- VERIFIED USER STYLE (Emerald) --- */
#comments .acs-body-inner.is-verified-user {
    background-color: var(--acs-verify-bg) !important;
    border: 1px solid var(--acs-verify-border) !important;
}

/* --- Header Section --- */
#comments .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 5px !important;
}

#comments .header-right {
    display: flex;
    align-items: center;
    width: 100%;
}

#comments img.comment-avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    margin-left: 12px !important;
    margin-right: 0 !important;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0 !important;
    display: block !important;
    float: none !important; /* Reset theme float */
}

#comments .user-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
}

#comments .author-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#comments .comment-author {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    font-style: normal;
}

#comments .comment-author a {
    color: inherit;
    text-decoration: none;
}

/* Role Badges */
#comments .user-role-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: #94a3b8;
    color: #fff;
    font-weight: 500;
}

/* Verified Badge Color */
#comments .acs-body-inner.is-verified-user .user-role-badge {
    background: var(--acs-verify-border); /* Emerald */
}

#comments .comment-date {
    font-size: 0.75rem;
    color: var(--acs-text-light);
    margin-top: 4px;
}

/* --- Content --- */
#comments .comment-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--acs-text);
    padding-right: 56px !important; /* Align with text */
    margin: 0 0 5px 0 !important;
    text-align: justify;
    border: none !important;
}

#comments .comment-content p {
    margin: 0 0 10px !important;
}

/* --- Footer Actions --- */
#comments .comment-footer {
    display: flex;
    justify-content: flex-end; /* Left aligned RTL */
    margin-top: 0;
    border: none !important;
    padding: 0 !important;
}

#comments .comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#comments .comment-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1;
}

#comments .comment-reply-link {
    background: #eff6ff !important;
    color: #3b82f6 !important;
}
#comments .comment-reply-link:hover {
    background: #dbeafe !important;
}

#comments .vote-actions {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
}

#comments .like-btn, 
#comments .dislike-btn {
    background: transparent !important;
    color: #64748b !important;
    padding: 4px 8px !important;
}

#comments .like-btn:hover, 
#comments .dislike-btn:hover {
    background: #fff !important;
    color: var(--acs-verify-border) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#comments .comment-actions svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

/* --- Load More --- */
#comments .acs-load-more-container {
    text-align: center;
    margin: 40px 0;
    clear: both;
}

#comments #acs-load-more {
    background: #fff;
    color: var(--acs-primary);
    border: 1px solid var(--acs-primary);
    padding: 10px 35px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#comments #acs-load-more:hover {
    background: var(--acs-primary);
    color: #fff;
}

#comments .acs-loader {
    display: inline-flex;
    vertical-align: middle;
    animation: acs-spin 1s linear infinite;
    color: var(--acs-primary);
}

@keyframes acs-spin {
    100% { transform: rotate(360deg); }
}

#comments .acs-message {
    font-size: 0.85rem;
    color: #15803d;
    margin-right: 15px;
    display: none;
    font-weight: 500;
}

#comments .acs-no-comments {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    #comments .acs-input-group {
        flex-direction: column;
    }
    
    #comments .comment-content {
        padding-right: 0 !important;
    }
    
    #comments ul.children {
        margin-right: 15px !important;
    }
    
    /* Force reset mobile padding from theme */
    #comments .acs-body-inner {
        padding: 15px !important;
    }
}