/**
 * DBC Comments CSS
 * 
 * Styles for comment voting system
 * 
 * @package DailyBookChoice
 * @since 1.0.0
 */

/* =========================================================
   Comment Voting
   ========================================================= */

.dbc-comment-vote-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    vertical-align: middle;
}

.dbc-comment-vote-up,
.dbc-comment-vote-down {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 3px;
    min-width: 24px;
    height: 24px;
}

.dbc-comment-vote-up:hover {
    color: #16a34a;
    background-color: #f0fdf4;
}

.dbc-comment-vote-down:hover {
    color: #dc2626;
    background-color: #fef2f2;
}

.dbc-comment-vote-up.is-active {
    color: #16a34a;
    background-color: #dcfce7;
}

.dbc-comment-vote-down.is-active {
    color: #dc2626;
    background-color: #fee2e2;
}

.dbc-comment-vote-up i,
.dbc-comment-vote-down i {
    font-size: 8px;
    line-height: 1;
}

.dbc-comment-vote-up:disabled,
.dbc-comment-vote-down:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dbc-comment-vote-count {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    min-width: 30px;
    text-align: center;
    line-height: 1;
}

.dbc-comment-vote-container {
    display: inline-block;
    vertical-align: middle;
}

/* =========================================================
   Comments Section
   ========================================================= */

.dbc-comments-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.dbc-comments-header {
    margin-bottom: 30px;
}

.dbc-comments-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.dbc-comments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.dbc-comments-list > li {
    margin-bottom: 35px !important;
}

.dbc-comments-list .children,
.dbc-comments-list ol.children {
    list-style: none !important;
    padding: 0;
    margin-left: 60px;
    margin-top: 0;
    margin-bottom: 0 !important;
    counter-reset: none;
}

.dbc-comment-replies {
    padding-top: 0;
    overflow: hidden !important;
    /* Prevent layout shift during animation */
    box-sizing: border-box;
    /* Ensure content is clipped during animation */
    position: relative;
}

/* Replies toggle button */
.dbc-comment-replies-toggle-wrapper {
    margin-top: 8px;
    margin-left: 63px; /* Align with comment content (48px avatar + 15px gap) */
    margin-bottom: 12px;
    clear: both;
}

/* Adjust spacing when toggle is directly after comment item */
.dbc-comment-item ~ .dbc-comment-replies-toggle-wrapper {
    margin-top: 8px;
}

.dbc-comment-replies-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.dbc-comment-replies-toggle:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.dbc-comment-replies-toggle[aria-expanded="true"] {
    color: #374151;
}

.dbc-comment-replies-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    font-size: 11px;
}

.dbc-comment-replies-toggle[aria-expanded="true"] .dbc-comment-replies-toggle-icon {
    transform: rotate(180deg);
}

.dbc-comment-replies-toggle-text {
    user-select: none;
}

.dbc-comments-list .children li,
.dbc-comments-list ol.children li {
    list-style: none !important;
    counter-increment: none;
    margin-bottom: 48px;
}

.dbc-comments-list .children li:last-child,
.dbc-comments-list ol.children li:last-child {
    margin-bottom: 0;
}

.dbc-comments-list .children li::before,
.dbc-comments-list ol.children li::before {
    content: none !important;
}

/* Consistent spacing for all comment items - equal spacing for all */
.dbc-comment-item {
    margin-top: 20px !important;
    margin-bottom: 40px !important;
    padding-bottom: 0;
    border-bottom: none;
    overflow: visible; /* Allow tooltips from edit form to show */
    position: relative; /* Ensure tooltips are positioned correctly */
}

/* Consistent spacing for nested comments - same as standalone */
.dbc-comments-list .children > li,
.dbc-comments-list .dbc-comment-replies > li {
    margin-bottom: 40px !important;
}

.dbc-comment-item:last-child {
    margin-bottom: 0;
}

.dbc-comment-body {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.dbc-comment-avatar {
    flex-shrink: 0;
}

.dbc-comment-avatar-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.2s;
}

.dbc-comment-avatar-link:hover {
    opacity: 0.8;
}

.dbc-comment-avatar img,
.dbc-comment-avatar-link img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: block;
}

.dbc-comment-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.dbc-comment-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 0;
    margin-top: 0;
    flex-wrap: wrap;
    /* Position header to align with avatar center (avatar is 48px, center at 24px) */
    /* Adjust based on header line-height to center it vertically with avatar */
    line-height: 1.4;
    padding-top: 14px;
}

.dbc-comment-author {
    font-style: normal;
    font-weight: 600;
    font-size: 15px;
    color: #111827;
    line-height: 1.4;
    display: inline-block;
    vertical-align: baseline;
}

.dbc-comment-author a {
    color: #111827;
    text-decoration: none;
    display: inline-block;
    vertical-align: baseline;
}

.dbc-comment-author a:hover {
    text-decoration: underline;
}

.dbc-comment-date {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    display: inline-block;
    vertical-align: baseline;
}

.dbc-comment-edited {
    font-size: 12px;
    color: #9ca3af;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-style: italic;
    line-height: 1.4;
    vertical-align: baseline;
}

.dbc-comment-edited i {
    font-size: 11px;
    opacity: 0.7;
}

.dbc-comment-text {
    margin-bottom: 8px;
    margin-top: 12px;
    color: #374151;
    line-height: 1.6;
    font-size: 14px !important;
}

/* Match paragraph spacing in displayed comments */
.dbc-comment-text p {
    margin-top: 0;
    margin-bottom: 0.5em;
    display: block; /* Ensure paragraphs are block elements */
}

/* Ensure empty paragraphs (line breaks) are visible */
.dbc-comment-text p:empty {
    min-height: 1em; /* Make empty paragraphs take up space */
    margin-bottom: 0.5em;
}

/* Ensure paragraphs with only <br> are visible (line breaks) */
.dbc-comment-text p:has(> br:only-child),
.dbc-comment-text p > br:only-child {
    min-height: 1em;
}

/* Fallback for browsers that don't support :has() */
.dbc-comment-text p br {
    display: block;
    margin-bottom: 0.5em;
    content: "";
}

.dbc-comment-text p:first-child {
    margin-top: 0;
}

.dbc-comment-text p:last-child {
    margin-bottom: 0;
}

/* Ensure lists within comment text show bullets/numbers */
.dbc-comment-text ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding-left: 20px;
}

.dbc-comment-text ol {
    list-style-type: decimal;
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding-left: 20px;
}

.dbc-comment-text li {
    margin-bottom: 4px;
    list-style-position: outside;
}

.dbc-comment-text ul li {
    list-style-type: disc;
}

.dbc-comment-text ol li {
    list-style-type: decimal;
}

/* Ensure nested comments don't increase font size */
.dbc-comments-list .children .dbc-comment-text,
.dbc-comments-list .children .children .dbc-comment-text,
.dbc-comments-list .dbc-comment-replies .dbc-comment-text,
.dbc-comments-list .dbc-comment-replies .dbc-comment-replies .dbc-comment-text {
    font-size: 14px !important;
}

.dbc-comment-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 0;
    vertical-align: middle;
}

.dbc-comment-reply {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 1;
}

.dbc-comment-reply a {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
}

.dbc-comment-reply a:hover {
    text-decoration: underline;
}

.dbc-comments-empty {
    padding: 30px 0;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Comment Form Styles */
.dbc-comments-section .comment-form {
    margin-top: 0;
    margin-bottom: 40px;
    padding-top: 0;
    padding-bottom: 40px;
    border-top: none;
    border-bottom: none;
}

/* Reply form styling (compact version below comments) */
.dbc-comment-respond {
    margin-top: 12px;
    margin-left: 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Hide empty reply containers - only show when they have content */
.dbc-comment-respond:empty {
    display: none !important;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

/* Reply title styling - make it more prominent */
.dbc-comment-respond #reply-title,
.dbc-comment-respond .comment-reply-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.dbc-comment-respond #reply-title::before,
.dbc-comment-respond .comment-reply-title::before {
    content: "↩";
    font-size: 20px;
    color: #2563eb;
    margin-right: 8px;
}

.dbc-comment-respond #reply-title small,
.dbc-comment-respond .comment-reply-title small {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 4px;
    width: 100%;
}

.dbc-comment-respond #reply-title a,
.dbc-comment-respond .comment-reply-title a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.dbc-comment-respond #reply-title a:hover,
.dbc-comment-respond .comment-reply-title a:hover {
    text-decoration: underline;
}

/* Cancel Reply button - red styling, aligned right - hidden by default */
/* Matches Post Comment button style but with red colors */
#cancel-comment-reply-link {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    float: right;
    background-color: #dc2626 !important;
    color: #ffffff !important;
    padding: 4px 11px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-family: "Poppins", sans-serif !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    border: none !important;
    cursor: pointer;
    margin-left: 12px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-right: 0 !important;
    line-height: 1.4 !important;
}

/* Show cancel button when reply mode is active (class added by JavaScript) */
body.dbc-reply-mode #cancel-comment-reply-link,
.dbc-reply-active #cancel-comment-reply-link {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hover and focus states only for cancel button in reply forms */
.dbc-comment-respond #cancel-comment-reply-link:hover {
    background-color: #b91c1c !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.dbc-comment-respond #cancel-comment-reply-link:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.dbc-comment-respond .comment-form {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dbc-comment-respond .dbc-quill-editor {
    min-height: 120px;
}

.dbc-comment-respond .ql-editor {
    min-height: 80px;
    font-family: "Poppins", sans-serif !important;
}

.dbc-comment-respond .ql-editor.ql-blank::before {
    font-family: "Poppins", sans-serif !important;
}

/* Prevent main comment form from being moved */
#commentform-main {
    position: relative;
}

.dbc-comments-section .comment-form-comment {
    margin-bottom: 0;
}

.dbc-comments-section .comment-form-comment p {
    margin-bottom: 0;
}

.dbc-comments-section .comment-form-comment label {
    display: none;
}

.dbc-comments-section .comment-form-comment textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
}

.dbc-comments-section .comment-form-comment textarea::placeholder {
    font-family: "Poppins", sans-serif !important;
    color: #9ca3af;
}

/* Quill Editor Styles */
.dbc-comments-section .dbc-quill-editor {
    background: #f5f5f5;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    min-height: 200px;
    overflow: visible; /* Allow tooltips to show outside */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    position: relative; /* Ensure tooltips are positioned correctly */
}


.dbc-comments-section .dbc-quill-editor .ql-toolbar {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom: none;
    background: #f5f5f5;
    padding: 10px 14px;
    border-left: none;
    border-right: none;
    border-top: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0;
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar .ql-formats {
    margin-right: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar .ql-formats:not(:last-child)::after {
    content: '';
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    margin: 0 4px;
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    margin: 0;
    padding: 0;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar button svg {
    width: 16px;
    height: 16px;
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar button:hover {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar button.ql-active {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dbc-comments-section .dbc-quill-editor .ql-toolbar button.ql-active svg {
    opacity: 1;
}

.dbc-comments-section .dbc-quill-editor .ql-container {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    font-family: inherit;
    font-size: 14px;
    border-left: none;
    border-right: none;
    border-bottom: none;
    background: #ffffff;
    border-radius: 16px;
}

.dbc-comments-section .dbc-quill-editor .ql-editor {
    font-family: "Poppins", sans-serif !important;
    min-height: 150px;
    padding: 18px;
    cursor: text;
    line-height: 1.6;
    color: #374151;
    background: #ffffff;
    border-radius: 16px;
}

/* Hide @[username] patterns in Quill editor (they're kept for backend parsing but hidden visually) */
.dbc-comments-section .dbc-quill-editor .ql-editor {
    /* Hide patterns like " @[username]" that come after display names */
}
.dbc-comments-section .dbc-quill-editor .ql-editor * {
    /* Use regex replacement via JavaScript instead - CSS can't do this easily */
}

/* Match paragraph spacing in Quill editor to displayed comments */
.dbc-comments-section .dbc-quill-editor .ql-editor p {
    margin-top: 0 !important;
    margin-bottom: 0.5em !important;
}

.dbc-comments-section .dbc-quill-editor .ql-editor p:first-child {
    margin-top: 0 !important;
}

.dbc-comments-section .dbc-quill-editor .ql-editor p:last-child {
    margin-bottom: 0 !important;
}

/* Empty paragraphs (line breaks) should have minimal spacing */
.dbc-comments-section .dbc-quill-editor .ql-editor p:empty {
    margin-top: 0 !important;
    margin-bottom: 0.5em !important;
    min-height: 0.5em;
}

/* Paragraphs with only a <br> tag (line breaks) */
.dbc-comments-section .dbc-quill-editor .ql-editor p:has(br:only-child) {
    margin-top: 0 !important;
    margin-bottom: 0.5em !important;
    min-height: 0.5em;
}

/* Fallback for browsers that don't support :has() */
.dbc-comments-section .dbc-quill-editor .ql-editor p br:only-child {
    display: block;
    margin: 0.5em 0;
}

.dbc-comments-section .dbc-quill-editor .ql-editor.ql-blank::before {
    font-family: "Poppins", sans-serif !important;
    color: #9ca3af;
    font-style: normal;
    left: 16px;
}

.dbc-comments-section .dbc-quill-editor .ql-editor strong,
.dbc-comments-section .dbc-quill-editor .ql-editor b {
    font-weight: 700 !important;
}

.dbc-comments-section .dbc-quill-editor .ql-editor p strong,
.dbc-comments-section .dbc-quill-editor .ql-editor p b {
    font-weight: 700 !important;
}

.dbc-comments-section .dbc-quill-editor .ql-snow .ql-stroke {
    stroke: #374151;
    stroke-width: 1.5;
}

.dbc-comments-section .dbc-quill-editor .ql-snow .ql-stroke.ql-thin {
    stroke-width: 1;
}

.dbc-comments-section .dbc-quill-editor .ql-snow .ql-fill {
    fill: #374151;
}

.dbc-comments-section .dbc-quill-editor .ql-snow .ql-picker-label {
    color: #374151;
}

.dbc-comments-section .dbc-quill-editor .ql-snow .ql-picker-options {
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}


/* Force border-radius on Quill's default classes - direct targeting with highest specificity */
#comment-quill-editor .ql-toolbar.ql-snow,
.dbc-quill-editor .ql-toolbar.ql-snow,
#commentform .ql-toolbar.ql-snow,
.comment-form .ql-toolbar.ql-snow,
.dbc-comments-section .ql-toolbar.ql-snow {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#comment-quill-editor .ql-container.ql-snow,
.dbc-quill-editor .ql-container.ql-snow,
#commentform .ql-container.ql-snow,
.comment-form .ql-container.ql-snow,
.dbc-comments-section .ql-container.ql-snow {
    border-bottom-left-radius: 16px !important;
    border-bottom-right-radius: 16px !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

#comment-quill-editor.ql-snow,
.dbc-quill-editor.ql-snow {
    border-radius: 16px !important;
    overflow: visible !important; /* Allow tooltips to show outside */
    position: relative; /* Ensure tooltips are positioned relative to editor */
}

.dbc-comments-section .dbc-quill-editor .ql-editor * {
    cursor: text;
}

.dbc-comments-section .comment-form-comment textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dbc-comments-section .form-submit {
    margin-top: 24px;
    margin-bottom: 0;
    text-align: right;
}

.dbc-comments-section .comment-form #submit,
.dbc-comments-section .form-submit .submit {
    margin-top: 24px;
}

/* Global Quill editor border-radius - must be after all other rules */
.comment-respond .ql-toolbar.ql-snow,
#respond .ql-toolbar.ql-snow {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.comment-respond .ql-container.ql-snow,
#respond .ql-container.ql-snow {
    border-bottom-left-radius: 16px !important;
    border-bottom-right-radius: 16px !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* =========================================================
   Comment Controls (Sort & Search)
   ========================================================= */

.dbc-comments-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 16px;
    padding: 12px 0;
    border-top: none;
    flex-wrap: wrap;
}

.dbc-comments-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dbc-comments-sort label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.dbc-comments-sort select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 140px;
}

.dbc-comments-sort select:hover {
    border-color: #9ca3af;
}

.dbc-comments-sort select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dbc-comments-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.dbc-comments-search input[type="search"] {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    color: #374151;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dbc-comments-search input[type="search"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dbc-comments-search input[type="search"]::placeholder {
    font-family: "Poppins", sans-serif !important;
    color: #9ca3af;
}

.dbc-comment-search-clear {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.dbc-comment-search-clear:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.dbc-comments-loading,
.dbc-comments-loading-item {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* =========================================================
   Comment Actions (Report, Edit, Delete)
   ========================================================= */

.dbc-comment-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.dbc-comment-report,
.dbc-comment-actions {
    display: inline-flex;
    align-items: center;
}

.dbc-comment-report-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.dbc-comment-report-btn:hover:not(:disabled) {
    background: #fef2f2;
    color: #dc2626;
}

.dbc-comment-report-btn.is-reported {
    background: #fee2e2;
    color: #dc2626;
    cursor: not-allowed;
}

.dbc-comment-edit-btn,
.dbc-comment-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.dbc-comment-edit-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}

.dbc-comment-delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* =========================================================
   Comment Edit Form
   ========================================================= */

.dbc-comment-edit-form {
    margin-top: 12px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: visible; /* Allow tooltips to show outside */
    position: relative; /* Ensure tooltips are positioned correctly */
}

.dbc-comment-edit-editor-wrapper {
    margin-bottom: 12px;
}

.dbc-comment-edit-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.dbc-comment-edit-form .dbc-quill-editor {
    min-height: 150px;
    background: #fff;
    overflow: visible; /* Allow tooltips to show outside */
}

/* Quill link tooltip styles - ensure it appears above everything */
.ql-tooltip {
    z-index: 99999 !important;
    position: fixed !important; /* Use fixed positioning to escape container boundaries */
    transform: translateY(-100%) !important; /* Position above the link */
    margin-top: -8px !important;
}

.ql-tooltip.ql-editing {
    z-index: 100000 !important;
}

/* Quill link input tooltip */
.ql-tooltip input[type=text] {
    z-index: 100001 !important;
}

/* Ensure Quill tooltips aren't clipped by parent containers */
.dbc-comment-edit-editor-wrapper {
    overflow: visible !important;
    position: relative;
}

.dbc-comments-section .dbc-quill-editor .ql-container {
    overflow: visible !important;
}

.dbc-comments-section .dbc-quill-editor .ql-editor {
    overflow: visible !important;
}

/* Ensure parent containers don't clip tooltips */
.dbc-comments-list,
.dbc-comments-list ol,
.dbc-comments-list ul,
.dbc-comment-replies {
    overflow: visible !important;
}

/* Ensure comment content area doesn't clip */
.dbc-comment-content {
    overflow: visible !important;
    position: relative;
}

.dbc-comment-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.dbc-comment-edit-actions .button {
    padding: 4px 11px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 300;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Match Post Comment button style exactly */
.dbc-comments-section .comment-form #submit,
.dbc-comments-section .form-submit .submit,
.dbc-comment-edit-save {
    background-color: #232A35 !important;
    color: #fff !important;
    border: none !important;
    padding: 4px 11px !important;
    font-weight: 300 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dbc-comments-section .comment-form #submit:hover,
.dbc-comments-section .form-submit .submit:hover,
.dbc-comment-edit-save:hover {
    background-color: #151a22 !important;
    color: #fff !important;
}

.dbc-comment-edit-cancel {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.dbc-comment-edit-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* =========================================================
   Admin Reported Comments
   ========================================================= */

.dbc-report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dbc-report-actions .button {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .dbc-comment-vote-wrapper {
        gap: 3px;
        margin-left: 6px;
    }
    
    .dbc-comment-vote-up,
    .dbc-comment-vote-down {
        padding: 3px 5px;
        font-size: 13px;
        min-width: 22px;
        height: 22px;
    }
    
    .dbc-comment-vote-count {
        font-size: 12px;
        min-width: 28px;
    }
    
    .dbc-comments-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dbc-comments-sort,
    .dbc-comments-search {
        width: 100%;
    }
    
    .dbc-comments-sort select {
        width: 100%;
    }
    
    .dbc-comment-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   Comment Search Highlight
   ========================================================= */

.dbc-comment-search-highlight {
    background-color: #fef3c7;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    color: #92400e;
}

/* =========================================================
   Comment Mentions
   ========================================================= */

.dbc-comment-mention {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
    background-color: #eff6ff;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.dbc-comment-mention:hover {
    background-color: #dbeafe;
    text-decoration: underline;
}

/* Hide @[username] patterns that are part of mentions (they're kept for parsing but hidden visually) */
.dbc-comment-text {
    /* Hide @[username] patterns that come after display names in mentions */
    /* This is handled by the backend highlighting function, but we ensure no stray @[username] shows */
}

/* Mention autocomplete dropdown */
.dbc-mention-autocomplete {
    position: absolute;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10000;
    min-width: 250px;
    font-family: "Poppins", sans-serif;
}

.dbc-mention-autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f3f4f6;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.dbc-mention-autocomplete-item:last-child {
    border-bottom: none;
}

.dbc-mention-autocomplete-item:hover,
.dbc-mention-autocomplete-item.selected {
    background-color: #f3f4f6;
}

.dbc-mention-autocomplete-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dbc-mention-autocomplete-item-info {
    flex: 1;
    min-width: 0;
}

.dbc-mention-autocomplete-item-name {
    font-weight: 500;
    color: #111827;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dbc-mention-autocomplete-item-username {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

