/* ==========================================================================
   Docs Comments Widget — MkDocs Material Theme Integration
   Uses Material CSS custom properties for automatic dark/light theme support
   ========================================================================== */

.dc-widget {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--md-default-fg-color--lightest, rgba(0,0,0,0.07));
}

.dc-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--md-default-fg-color, inherit);
}

/* --- Comment List --- */

.dc-comments-list {
  margin-bottom: 1.5rem;
}

.dc-comments-list.dc-loading {
  color: var(--md-default-fg-color--light, #666);
  font-style: italic;
}

.dc-empty {
  color: var(--md-default-fg-color--light, #666);
  font-style: italic;
  margin: 0.5rem 0;
}

.dc-error {
  color: var(--md-accent-fg-color, #e53935);
  font-style: italic;
}

/* --- Individual Comment --- */

.dc-comment {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  background: var(--md-code-bg-color, rgba(0,0,0,0.04));
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0,0,0,0.07));
}

.dc-comment__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.dc-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dc-avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--md-primary-fg-color, #6f42c1);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dc-comment__author {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--md-default-fg-color, inherit);
}

.dc-comment__badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--md-default-fg-color--lightest, rgba(0,0,0,0.07));
  color: var(--md-default-fg-color--light, #666);
}

.dc-comment__time {
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light, #999);
  margin-left: auto;
}

.dc-comment__body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--md-default-fg-color, inherit);
  word-break: break-word;
}

.dc-comment__body a {
  color: var(--md-accent-fg-color, var(--md-primary-fg-color));
  text-decoration: underline;
}

.dc-inline-code {
  font-family: var(--md-code-font-family, 'JetBrains Mono', monospace);
  font-size: 0.85em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--md-code-bg-color, rgba(0,0,0,0.04));
}

/* --- Form --- */

.dc-form {
  padding: 1rem;
  border-radius: 8px;
  background: var(--md-code-bg-color, rgba(0,0,0,0.04));
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0,0,0,0.07));
}

.dc-form__row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dc-form__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--md-default-fg-color, inherit);
}

.dc-input,
.dc-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0,0,0,0.12));
  border-radius: 6px;
  background: var(--md-default-bg-color, #fff);
  color: var(--md-default-fg-color, inherit);
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.dc-input:focus,
.dc-textarea:focus {
  outline: none;
  border-color: var(--md-primary-fg-color, #6f42c1);
  box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.15);
}

.dc-textarea {
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0.5rem;
}

.dc-form__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dc-form__note {
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light, #999);
  margin: 0.5rem 0 0;
  font-style: italic;
}

/* Honeypot — visually hidden */
.dc-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- Buttons --- */

.dc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.dc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dc-btn--primary {
  background: var(--md-primary-fg-color, #6f42c1);
  color: var(--md-primary-bg-color, #fff);
}

.dc-btn--primary:hover:not(:disabled) {
  opacity: 0.9;
}

.dc-btn--outline {
  background: transparent;
  border: 1px solid var(--md-primary-fg-color, #6f42c1);
  color: var(--md-primary-fg-color, #6f42c1);
}

.dc-btn--outline:hover:not(:disabled) {
  background: rgba(111, 66, 193, 0.08);
}

.dc-btn--text {
  background: transparent;
  color: var(--md-default-fg-color--light, #999);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.dc-btn--text:hover {
  color: var(--md-default-fg-color, inherit);
}

/* --- Messages --- */

.dc-form-message {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  animation: dc-fade-in 0.2s ease;
}

.dc-form-message--error {
  background: rgba(229, 57, 53, 0.1);
  color: #e53935;
  border: 1px solid rgba(229, 57, 53, 0.2);
}

.dc-form-message--success {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

@keyframes dc-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .dc-form__row {
    flex-direction: column;
  }

  .dc-comment__time {
    margin-left: 0;
    width: 100%;
    order: 10;
    margin-top: 0.25rem;
  }

  .dc-form__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dc-btn {
    justify-content: center;
  }
}
