/* Comments - minimal design */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--code-border, #e5e7eb);
}

.comments-section__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--content-primary, #1a1a1a);
}

/* Comments list */
.comments-list {
  margin-bottom: 2rem;
}

.comments-list:empty {
  display: none;
}

.comment {
  background: var(--code-background, #f5f5f5);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  position: relative;
  transition: background 1s;
}

.comment__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment__meta {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--content-secondary, #6b7280);
}

.comment__author {
  color: var(--content-primary, #1a1a1a);
  font-weight: 500;
  font-family: monospace;
}

.comment__crown {
  margin-left: 0.3rem;
  display: inline-flex;
  vertical-align: baseline;
  color: #d4a017;
}

.comment__crown svg {
  position: relative;
  top: 0.15em;
}

.comment__content {
  color: var(--content-primary, #1a1a1a);
  line-height: 1.6;
}

/* Mentions */
.comment__mention {
  font-family: var(--mono-font, monospace);
  font-weight: 600;
  font-size: 0.9em;
  color: var(--content-primary, #1a1a1a);
}

/* Highlight when current user is mentioned */
.comment__mention--self {
  background: #fff8c5;
  padding: 0.1em 0.2em;
  border-radius: 3px;
}

.dark .comment__mention--self {
  background: rgba(215, 153, 33, 0.25);
}

/* Highlighted comment (when linked directly) */
.comment.comment--highlighted {
  background: #fff8c5;
}

.dark .comment.comment--highlighted {
  background: rgba(215, 153, 33, 0.25);
}

/* Deleted comment */
.comment--deleted {
  border-left: 3px solid #dc2626;
  opacity: 0.7;
}

.comment__deleted {
  font-style: italic;
  color: var(--content-secondary, #6b7280);
  font-size: 0.9rem;
}

.comment__deleted-label {
  color: #dc2626;
  font-size: 0.8em;
}

/* 3-dot menu */
.comment__menu {
  position: relative;
  opacity: 0;
  transition: opacity 0.15s;
}

.comment:hover .comment__menu {
  opacity: 1;
}

.comment__menu--visible {
  opacity: 1;
}

.comment__menu-btn {
  background: none;
  border: none;
  color: var(--bg4);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 4px;
}

.comment__menu-btn:hover {
  color: var(--bg3);
}

.comment__menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--code-background);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 100px;
  z-index: 10;
  overflow: hidden;
}

.comment__menu-dropdown.open {
  display: block;
}

.comment__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--content-primary);
  cursor: pointer;
}

.comment__menu-item:hover {
  background: var(--code-background);
}

.comment__menu-item[data-action="delete"]:hover {
  color: var(--red1);
}

/* Comment form */
.comment-form__box {
  border: 1px solid var(--code-border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}

.comment-form__textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  background: var(--background, #ffffff);
  color: var(--content-primary, #1a1a1a);
}

.comment-form__textarea:focus {
  outline: none;
}

.comment-form__textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.comment-form__textarea::placeholder {
  color: var(--content-secondary, #6b7280);
}

.comment-form__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.15rem 0.4rem;
  background: var(--code-background, #f5f5f5);
  border-top: 1px solid var(--code-border, #e5e7eb);
}

.comment-form__post {
  background: var(--content-primary, #1a1a1a);
  color: var(--background, #ffffff);
  border: none;
  padding: 0.2rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
}

.comment-form__post:hover {
  opacity: 0.9;
}

.comment-form__post:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Auth modal */
.comments-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comments-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.comments-auth-modal__content {
  position: relative;
  background: var(--background, #ffffff);
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.comments-auth-modal__content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--content-primary, #1a1a1a);
}

.comments-auth-modal__content p {
  color: var(--content-secondary, #6b7280);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.comments-auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--content-secondary, #6b7280);
  line-height: 1;
}

/* Auth modal tabs */
.comments-auth-modal__tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--code-border, #e5e7eb);
}

.comments-auth-modal__tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--content-secondary, #6b7280);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.comments-auth-modal__tab:hover {
  color: var(--content-primary, #1a1a1a);
}

.comments-auth-modal__tab.active {
  color: var(--content-primary, #1a1a1a);
  border-bottom-color: var(--content-primary, #1a1a1a);
}

.comments-auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comments-auth-modal__content input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--code-border, #e5e7eb);
  border-radius: 4px;
  font-size: 0.95rem;
  background: var(--background, #ffffff);
  color: var(--content-primary, #1a1a1a);
  width: 100%;
  box-sizing: border-box;
}

.comments-auth-modal__content input:focus {
  outline: none;
  border-color: var(--content-secondary, #6b7280);
}

.comments-auth-modal__content input:disabled {
  opacity: 0.6;
}

.comments-auth-modal__form button {
  background: var(--content-primary, #1a1a1a);
  color: var(--background, #ffffff);
  border: none;
  padding: 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}

.comments-auth-modal__status {
  text-align: center;
  font-size: 0.85rem;
  color: var(--content-secondary, #6b7280);
}

/* Toast */
.comments-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--content-primary, #1a1a1a);
  color: var(--background, #ffffff);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1001;
}

.comments-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Auth status bar */
.comments-auth-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--code-background, #f5f5f5);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--content-secondary, #6b7280);
}

.comments-signout-btn {
  background: none;
  border: none;
  color: var(--content-secondary, #6b7280);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
}

.comments-signout-btn:hover {
  color: var(--content-primary, #1a1a1a);
}
