/* Comments Panel Styles */

.comments-panel {
  width: 320px;
  min-width: 320px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #dedede;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: -320px;
  transition: margin-right 0.2s ease;
}

.comments-panel.open {
  margin-right: 0;
}

/* Header */
/* Removed - no longer using header
.comments-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.comments-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #141414;
}

.comments-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.comments-close:hover {
  color: #141414;
}
*/

/* Controls */
.comments-controls {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}

.show-resolved-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

.show-resolved-toggle input[type="checkbox"] {
  cursor: pointer;
}

.show-resolved-toggle label {
  cursor: pointer;
  user-select: none;
}

/* Content */
.comments-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.empty-comments {
  text-align: center;
  color: #9ca3af;
  padding: 40px 20px;
  font-size: 14px;
}

/* Comment Section Groups */
.comment-section-group {
  margin-bottom: 24px;
}

.comment-section-group:last-child {
  margin-bottom: 0;
}

.comment-section-header {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.comment-section-group.orphaned .comment-section-header {
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.orphaned-header i {
  font-size: 14px;
}

/* Comment Cards */
.comment-card {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.comment-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comment-card.highlighted,
.comment-card.highlighted:hover {
  border-color: #1a1a1a;
  background-color: #f0f7ff;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.comment-card.resolved {
  opacity: 0.6;
  background: #f9fafb;
}

.comment-card-highlight {
  background-color: rgba(250, 204, 21, 0.35);
  padding: 2px 4px;
  margin-bottom: 8px;
  font-size: 12px;
  font-style: italic;
  color: #6b7280;
  border-radius: 2px;
  display: inline-block;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.comment-author {
  font-weight: 600;
  color: #374151;
}

.comment-time {
  color: #9ca3af;
}

.comment-resolved-badge {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.comment-content {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  white-space: normal;
  word-wrap: break-word;
}

.comment-content p {
  text-indent: 0;
  margin: 0;
}

.comment-content p + p {
  margin-top: 8px;
}

.comment-replies {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.comment-reply {
  padding: 8px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}

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

.reply-author {
  font-weight: 600;
  color: #374151;
  margin-right: 8px;
}

.reply-time {
  color: #9ca3af;
  font-size: 11px;
}

.reply-content {
  margin-top: 4px;
  color: #4b5563;
}

.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.comment-action-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.comment-action-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Comments Toggle Button in Nav Bar */
.comments-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

/* Pink badge with number */
.comments-toggle.has-comments {
  background-color: #d4145a;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  min-width: 24px;
  height: 24px;
}

.comments-toggle.has-comments:hover {
  background: #b01249;
  transform: scale(1.05);
}

/* Just the icon, no background */
.comments-toggle:not(.has-comments) {
  background: none;
  color: #666;
  padding: 0;
  min-width: 24px;
  height: 24px;
}

.comments-toggle:not(.has-comments):hover {
  color: #d4145a;
  transform: scale(1.1);
}

.comments-toggle i {
  font-size: 18px;
}

/* Reply input */
.reply-input-container {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.reply-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.reply-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.reply-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Comment Creation Popover */
.comment-popover {
    width: 320px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.comment-popover-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #141414;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-popover-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 18px;
}

.comment-popover-close:hover {
    background: #e5e5e5;
    color: #141414;
}

.comment-popover-body {
    padding: 16px;
}

.comment-popover-body textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

/* Comment actions layout */
.comment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.comment-action-icons {
    display: flex;
    gap: 4px;
}

/* Icon buttons */
.icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}

.icon-btn:hover {
    background-color: #e5e5e5;
    color: #333;
}

.icon-btn i {
    font-size: 16px;
}

/* Small icon buttons for replies */
.icon-btn-sm {
    width: 24px;
    height: 24px;
}

.icon-btn-sm i {
    font-size: 14px;
}

/* Delete button red on hover */
.delete-comment-btn:hover,
.delete-reply-btn:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

/* Reply header layout */
.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.reply-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-action-icons {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.comment-reply:hover .reply-action-icons {
    opacity: 1;
}

/* Edit inputs */
.edit-comment-input,
.edit-reply-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
    resize: vertical;
}

.comment-popover-body textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.comment-popover-actions {
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}
