/* Custom BlurAnime Comments UI (wpDiscuz Clone) */
.ba-comments-wrapper { font-family: 'Mulish', sans-serif; color: #333; margin-top: 0; clear: both; display: flow-root; width: 100%; float: none; }
.ba-comments-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px;}
.ba-comments-title { font-size: 22px; font-weight: 800; margin: 0; color: #111; }
.ba-comments-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Toggle */
.ba-toggle-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #444; }
.ba-toggle { width: 40px; height: 22px; background: #3498db; border-radius: 12px; position: relative; cursor: pointer; transition: 0.3s;}
.ba-toggle::after { content: ''; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: 0.3s; }
.ba-toggle.off { background: #ccc; }
.ba-toggle.off::after { right: 20px; }

/* Buttons */
.ba-icon-btn { border: 1px solid #ddd; background: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: #555; height: 34px; font-size: 12px; font-weight: 700; font-family: inherit; transition: all 0.2s ease; }
.ba-icon-btn:hover { border-color: #fb9351; color: #fb9351; }
.ba-icon-btn.active { background: #fb9351; border-color: #fb9351; color: #fff; }
.ba-icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.ba-sort-dropdown { position: relative; }
.ba-sort-dropdown select { appearance: none; border: 1px solid #ddd; background: #fff; padding: 6px 30px 6px 12px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #555; cursor: pointer; font-family: inherit; height: 34px;}
.ba-sort-dropdown::after { content: '⌄'; position: absolute; right: 10px; top: 3px; pointer-events: none; color: #555; font-size: 18px;}

/* Editor */
.ba-editor { border: 1px solid #cbd0d4; border-radius: 8px; background: #fff; margin-bottom: 25px; box-shadow: 0 4px 14px rgba(0,0,0,0.06); overflow: hidden; }
.ba-toolbar { display: flex; gap: 15px; padding: 10px 15px; border-bottom: 1px solid #eaeaea; background: #f7f9fa; flex-wrap: wrap; }
.ba-toolbar button { background: none; border: none; padding: 0; cursor: pointer; color: #555; display: flex; align-items: center; justify-content: center; transition: color 0.2s; }
.ba-toolbar button:hover { color: #3498db; }
.ba-toolbar button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
div#comments.ba-comments-wrapper form#commentform { margin: 0; padding: 0; }
.ba-textarea-wrap { padding: 0; }
div#comments.ba-comments-wrapper form#commentform .ba-textarea-wrap textarea#comment { width: 100%; max-width: 100%; box-sizing: border-box; border: none; padding: 15px; margin: 0; min-height: 100px; resize: none; overflow-y: hidden; outline: none; font-family: inherit; font-size: 14px; background: transparent; display: block; box-shadow: none; }
.ba-submit-wrap { padding: 15px; background: #f7f9fa; border-top: 1px solid #eaeaea; display: flex; justify-content: flex-start;}
.ba-btn-submit { background: #3498db; color: #fff; border: none; padding: 8px 20px; border-radius: 4px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.ba-btn-submit:hover { background: #2980b9; }

/* Login Box */
.custom-comment-login { background: #eef7fe; border: 1px solid #bde0fe; border-radius: 8px; padding: 24px 20px; text-align: center; margin-bottom: 10px; }
.custom-comment-login p { color: #1982c4; font-size: 15px; font-weight: 700; margin: 0 0 14px 0; }
.btn-comment-login { background: #1fb0f4; color: #fff; padding: 10px 26px; border-radius: 6px; text-decoration: none; font-weight: 800; font-size: 14px; display: inline-block; transition: background 0.2s ease, transform 0.15s ease; }
.btn-comment-login:hover { background: #0d99dc; transform: translateY(-1px); }

/* Comment List */
.ba-comment-list { list-style: none; padding: 0; margin: 0; clear: both; display: flow-root; }
.ba-comment-list .children { display: none; list-style: none; padding-left: 40px; margin-top: 15px; border-left: 2px solid #eee; }
div#comments .ba-comment-list .ba-comment-item { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 20px; margin-bottom: 15px; clear: both; float: none; display: block; width: 100%; }
.ba-comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.ba-user-info { display: flex; align-items: center; gap: 10px; }
.ba-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.ba-author-name { font-weight: 700; color: #333; font-size: 14px; display: flex; align-items: center; gap: 5px; }
.ba-badges { display: flex; gap: 2px; }
.ba-badges img { width: 16px; height: 16px; }
.ba-time { color: #999; font-size: 12px; }
.ba-comment-content { font-size: 14px; color: #444; line-height: 1.6; margin-bottom: 15px; word-break: break-word;}
.ba-comment-content img { max-width: 100%; border-radius: 4px; margin-top: 10px; }
.ba-comment-actions { display: flex; align-items: center; gap: 10px; border-top: 1px solid #f0f0f0; padding-top: 15px; }
.ba-action-btn { background: #f0f2f5; border: none; padding: 5px 12px; border-radius: 15px; font-size: 12px; font-weight: 600; color: #555; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: 0.2s; text-decoration: none; }
.ba-action-btn:hover { background: #e4e6e9; color: #333; text-decoration: none;}
.ba-action-btn.liked { background: #e8f4fd; color: #3498db; }
.ba-action-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.ba-action-btn.liked svg { fill: #3498db; }


/* Comment Header Tools */
.ba-header-right { display: flex; align-items: center; gap: 10px; }
.ba-comment-tools { display: flex; align-items: center; gap: 2px; }
.ba-tool-btn { background: none; border: none; padding: 4px; cursor: pointer; color: #a0a0a0; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: 0.2s; }
.ba-tool-btn:hover { background: #f0f0f0; color: #333; }
.ba-tool-btn svg { width: 16px; height: 16px; fill: none; }
.ba-dropdown-container { position: relative; }
.ba-dropdown-menu { position: absolute; top: 100%; right: 0; background: #fff; border: 1px solid #eaeaea; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); min-width: 120px; z-index: 10; display: none; flex-direction: column; padding: 5px 0; margin-top: 5px; }
.ba-dropdown-menu.show { display: flex; }
.ba-dropdown-item { background: none; border: none; padding: 8px 15px; text-align: left; width: 100%; cursor: pointer; font-size: 13px; color: #555; transition: 0.2s; font-family: inherit; }
.ba-dropdown-item:hover { background: #f8f9fa; color: #000; }

/* Collapsed State */
.ba-comment-item.collapsed .ba-comment-content,
.ba-comment-item.collapsed .ba-comment-actions { display: none; }
.ba-comment-item.collapsed .ba-icon-minus { display: none; }
.ba-comment-item.collapsed .ba-icon-plus { display: block; }
.ba-comment-item.collapsed { padding-bottom: 15px; }

/* Dark Mode Extensions */
body.dark-mode .ba-tool-btn:hover { background: #3b3b55; color: #eee; }
body.dark-mode .ba-dropdown-menu { background: #1a1a2e; border-color: #2b2b40; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
body.dark-mode .ba-dropdown-item { color: #ccc; }
body.dark-mode .ba-dropdown-item:hover { background: #222238; color: #fff; }

/* Dark Mode */
body.dark-mode .ba-comments-title { color: #eee; }
body.dark-mode .ba-toggle-wrap { color: #ccc; }
body.dark-mode .ba-editor, body.dark-mode .ba-comment-item, body.dark-mode .ba-sort-dropdown select, body.dark-mode .ba-icon-btn { background: #1a1a2e; border-color: #3b3b55; color: #ccc; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
body.dark-mode .ba-icon-btn.active { background: #fb9351; border-color: #fb9351; color: #fff; }
body.dark-mode .ba-toolbar, body.dark-mode .ba-submit-wrap { background: #222238; border-color: #2b2b40; }
body.dark-mode .ba-textarea-wrap textarea, body.dark-mode .ba-edit-textarea { color: #eee; background: #1a1a2e; border-color: #2b2b40; }
body.dark-mode .ba-author-name { color: #eee; }
body.dark-mode .ba-comment-content { color: #ddd; }
body.dark-mode .ba-action-btn { background: #2b2b40; color: #aaa; }
body.dark-mode .ba-action-btn:hover { background: #3b3b55; }
body.dark-mode .ba-comment-actions { border-top-color: #2b2b40; }
body.dark-mode .ba-comment-list .children { border-left-color: #2b2b40; }
body.dark-mode .custom-comment-login { background: rgba(31, 176, 244, 0.08); border-color: rgba(31, 176, 244, 0.3); }
body.dark-mode .custom-comment-login p { color: #5bc0f8; }

.ba-image-attachment { position: relative; display: inline-block; margin-top: 10px; max-width: 100%; border: 1px solid #eee; padding: 4px; border-radius: 4px; background: #fafafa;}
.ba-image-attachment img { max-width: 100%; border-radius: 4px; display: block; max-height: 400px; object-fit: contain;}
.ba-remove-image { position: absolute; top: 4px; right: 4px; background: #e74c3c; color: #fff; border: none; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; font-weight: bold; border-radius: 0 4px 0 4px; transition: 0.2s;}
.ba-remove-image:hover { background: #c0392b; }
.ba-upload-progress { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #555; font-weight: bold;}
.ba-progress-bar-bg { flex-grow: 1; background: #eee; height: 8px; border-radius: 4px; overflow: hidden; position: relative;}
.ba-progress-bar-fill { background: #3498db; height: 100%; width: 0%; transition: width 0.2s; }
body.dark-mode .ba-image-attachment { background: #1a1a2e; border-color: #2b2b40;}
body.dark-mode .ba-progress-bar-bg { background: #3b3b55; }

@media (max-width: 767px) {
    .ba-comments-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ba-comments-controls { width: 100%; justify-content: space-between; gap: 8px; }
    .ba-comments-title { font-size: 18px; }
    .ba-sort-dropdown select { padding: 6px 26px 6px 10px; font-size: 12px; }
    .ba-icon-btn { padding: 6px 10px; font-size: 11px; }
    .custom-comment-login { padding: 18px 14px; }
}
