/* Clout Web UI Styles - trust layer
   Trust circle list, trust requests, trust weight slider, trust explainer,
   trust context badges, hop-distance feed styling, nicknames, day-pass delegation,
   media trust filters, trust tags management. */

@layer trust {
/* Mute/unmute buttons in trust list */
.btn-mute, .btn-unmute {
  font-size: 0.9rem;
}

.btn-mute:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-unmute:hover {
  background: rgba(34, 197, 94, 0.2);
}

/* Untrust button (remove from circle) */
.btn-untrust {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.btn-untrust:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Muted user styling in trust list */
.trusted-user-card.muted {
  opacity: 0.6;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent);
}

.muted-name {
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
}

.muted-badge {
  font-size: 0.65rem;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

/* Trust Weight Badge */
.weight-badge {
  font-size: 0.7rem;
  font-family: 'Monaco', 'Menlo', monospace;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-weight: 600;
}

.weight-badge.weight-full {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.weight-badge.weight-medium {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.weight-badge.weight-low {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}
/* Delegation Form */
.delegate-form {
  margin-top: 1rem;
}

.delegation-status {
  margin-bottom: 1rem;
}
/* Media Filters */
.media-filters {
  margin-bottom: 1rem;
}

.media-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.media-filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.media-icon {
  font-size: 1.2rem;
}

.media-filter-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.media-filter-controls label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0;
}

.select-small {
  width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* Tags Management */
.tags-manager {
  margin-top: 1rem;
}

.tags-list {
  margin-bottom: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.tag-name {
  font-weight: 600;
  color: var(--text);
}

.tag-count {
  color: var(--text-dim);
  font-size: 0.85rem;
  flex: 1;
}

.add-tag-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.add-tag-form .input {
  flex: 1;
  min-width: 150px;
}
/* Trust Network Section */
.trust-network-section {
  margin-bottom: 2rem;
}

.trust-count {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.trusted-users-list {
  max-height: 300px;
  overflow-y: auto;
}

.trusted-user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.trusted-user-card:hover {
  border-color: var(--primary);
}

/* Self card styling - you trust yourself above all */
.trusted-user-card.self-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  border-color: var(--primary);
}

.self-badge {
  display: inline-block;
  font-size: 0.65rem;
  background: var(--primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

.trusted-user-info {
  flex: 1;
}

.trusted-user-key {
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text);
}

.user-tags {
  margin-top: 0.5rem;
}

.tag-badge-small {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-right: 0.25rem;
}

/* Add Trust Card */
.add-trust-card {
  margin-bottom: 2rem;
}

.trust-input-row {
  display: flex;
  gap: 0.5rem;
}

.trust-input-row .input {
  flex: 1;
}

/* Trust Weight Slider */
.trust-weight-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
}

.trust-weight-row label {
  font-size: 0.9rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.trust-weight-slider {
  flex: 1;
  min-width: 100px;
}

.trust-weight-display {
  font-family: 'Monaco', 'Menlo', monospace;
  font-weight: bold;
  color: var(--primary);
  min-width: 2.5rem;
  text-align: center;
}

.trust-weight-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  min-width: 90px;
}
/* Trust Explainer */
.trust-explainer {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.trust-explainer h4 {
  margin-bottom: 1rem;
  color: var(--text);
}

.trust-levels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trust-level {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg);
}

.trust-level.level-self {
  border-left: 3px solid var(--primary);
}

.trust-level.level-1 {
  border-left: 3px solid #22c55e;
}

.trust-level.level-2 {
  border-left: 3px solid #eab308;
}

.trust-level.level-3 {
  border-left: 3px solid #f97316;
}

.level-icon {
  font-size: 1.5rem;
}

.level-info strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.level-info p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0;
}
/* Trust Context on Posts */
.feed-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.trust-context {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.trust-context.trust-self {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.trust-context.trust-direct {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.trust-context.trust-indirect {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

/* Visual Hierarchy by Trust Distance */
.feed-item.distance-0 {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
}

.feed-item.distance-1 {
  border-left: 3px solid #22c55e;
}

.feed-item.distance-2 {
  border-left: 3px solid #eab308;
  opacity: 0.95;
}

.feed-item.distance-3 {
  border-left: 3px solid #f97316;
  opacity: 0.9;
}
/* Quick Trust Button */
.btn-trust-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin-left: 0.5rem;
  transition: all 0.2s;
}

.btn-trust-quick:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
/* Network Overview (in Trust tab) */
.network-overview {
  display: flex;
  justify-content: space-around;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.overview-stat {
  text-align: center;
}

.overview-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.overview-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* =========================================================================
   NICKNAME STYLES (Local Address Book)
   ========================================================================= */

/* Nickname indicator - shows that this is a custom name, not a key */
.has-nickname {
  color: var(--text);
  font-weight: 500;
  font-family: inherit; /* Override monospace for nicknames */
}

/* When nickname is set, show it prominently */
.trusted-user-name {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.trusted-user-name.has-nickname {
  color: var(--text);
  font-weight: 600;
}

/* Show the key in smaller text below the name */
.trusted-user-key-small {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  opacity: 0.8;
}

/* Edit nickname button */
.btn-nickname {
  padding: 0.35rem 0.5rem !important;
  font-size: 0.85rem !important;
}

.btn-nickname:hover {
  background: var(--secondary) !important;
}

/* Trusted user actions layout */
.trusted-user-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .trust-input-row {
    flex-direction: column;
  }

  .empty-actions {
    flex-direction: column;
  }

  .empty-actions .btn {
    width: 100%;
  }

  .network-overview {
    flex-direction: column;
    gap: 1rem;
  }

  .trusted-user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .trusted-user-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
/* =========================================================================
   TRUST REQUESTS (Consent-based trust)
   ========================================================================= */

.trust-requests-card {
  margin-bottom: 1rem;
}

.trust-requests-section {
  margin-bottom: 1.5rem;
}

.trust-requests-section h4 {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.trust-requests-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trust-request-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.trust-request-avatar {
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.trust-request-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.trust-request-key {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.trust-request-card.incoming {
  border-left: 3px solid var(--accent);
}

.trust-request-card.outgoing {
  border-left: 3px solid var(--text-dim);
}

.trust-request-card.ghosted {
  opacity: 0.5;
  border-left-color: var(--text-dim);
}

.trust-request-info {
  flex: 1;
  min-width: 0;
}

.trust-request-name {
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trust-request-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.trust-request-time {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.trust-request-message {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.trust-request-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Trust request badges */
.pending-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  text-transform: uppercase;
  font-weight: 600;
}

.ghost-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
}

/* Trust request action buttons */
.btn-accept {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid #10b981;
}

.btn-accept:hover {
  background: rgba(16, 185, 129, 0.3);
}

.btn-reject {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.btn-reject:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-withdraw {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
  border: 1px solid #6b7280;
}

.btn-withdraw:hover {
  background: rgba(107, 114, 128, 0.3);
}

.btn-retry {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid #3b82f6;
}

.btn-retry:hover {
  background: rgba(59, 130, 246, 0.3);
}

/* Empty state for requests */
.empty-state-small {
  padding: 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Badge for notification count */
.badge-notification {
  background: var(--accent);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 0.5rem;
}
} /* end @layer trust */
