.custom-comments {
    max-width: 800px;
    margin: 0 auto;
    direction: rtl;
}

.comment-form-container {
    margin-bottom: 30px;
}

.comment-form-container h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.ajax-comment-form {
    display: grid;
    gap: 15px;
}

.ajax-comment-form input,
.ajax-comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.ajax-comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-comment {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-comment:hover {
    background: #0056b3;
}

.comments-list h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.comments-list ul {
    list-style: none;
    padding: 0;
}

.comment {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 10px;
    background: #ffffff;
    border-radius: 8px;
    border: solid 2px #e5e7eb;
}

.child-comment {
    margin-right: 5px;
    padding: 10px !important;
}

.admin-comment {
    border: solid 2px #a4f4cf;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: solid 1px #e5e7eb;
    padding-bottom: 5px;
}

img.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 10px;
    border: 1px solid #ddd !important;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    margin-block-end: unset !important;
}

.comment-author {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-role {
    background: #e0e0e0;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: normal;
}

.comment-date {
    color: #666;
    font-size: 0.9em;
}

.comment-content {
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap; /* Keep buttons in one line */
}

.comment-actions button {
    border: none;
    padding: 5px !important;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #404040;
    font-size: 0.8rem;
}

.like-btn {
    background-color: #e6f4ea !important; /* Soft green */
}

.dislike-btn {
    background-color: #f8e1e1 !important; /* Soft red */
}

.comment-reply-link {
    background: #e1ecf8 !important; /* Soft blue */
}

.like-btn:hover {
    background-color: #d0e8d4 !important;
}

.dislike-btn:hover {
    background: #f0c9c9 !important;
}

.comment-reply-link:hover {
    background: #c7ddf0 !important;
}

.like-btn svg, .dislike-btn svg, .comment-reply-link svg {
    width: 16px;
    height: 16px;
}

.reply-form-container {
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.success-message {
    background: #e6f4ea;
    color: #2e7d32;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    text-align: center;
    display: none;
}

@media (max-width: 600px) {
    .comment {
        padding: 10px;
    }

    .comment-avatar {
        width: 30px;
        height: 30px;
    }

    .comment-actions {
        flex-wrap: nowrap; /* Keep buttons in one line on mobile */
        gap: 5px;
    }

    .like-btn, .dislike-btn, .comment-reply-link {
        padding: 6px 10px; /* Slightly smaller padding on mobile */
    }
}