/* Clout Web UI Styles - profile layer
   Profile card, identity section, public key box, QR code,
   identity management (import/export/list), data sections. */

@layer profile {
/* Identity Card */
.identity-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.identity-field {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.identity-field:last-child {
  margin-bottom: 0;
}

.identity-field label {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.identity-value {
  background: var(--bg-card);
  padding: 0.75rem;
  border-radius: 6px;
  font-family: monospace;
  word-break: break-all;
  font-size: 0.9rem;
}

/* QR Code */
.qr-code-container {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: 12px;
  text-align: center;
}

.qr-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.qr-code-header h4 {
  color: var(--primary);
  font-size: 1.1rem;
  margin: 0;
}

.qr-code {
  display: inline-block;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  margin: 1rem auto;
}

.qr-code-help {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 1rem 0 0 0;
}
/* Profile Styles */
.profile-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  /* Contain the cover banner so its negative margins don't overflow
     the card's rounded corners. */
  overflow: hidden;
}

/* Generative profile cover banner — a fractal SVG derived from the
   user's public key, rendered as a background-image. Spans the full
   width of the card (negative margins counteract .profile-card padding)
   and sits above the profile header. See js/utils/identicon.js. */
.profile-cover {
  height: 120px;
  margin: -2rem -2rem 1.5rem -2rem;
  background-color: var(--bg-secondary);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Round only the top corners to hug the card. */
  border-radius: 12px 12px 0 0;
}

.profile-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
  overflow: hidden;
}

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

.profile-info h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
  font-size: 1.5rem;
}

.profile-bio {
  color: var(--text);
  margin: 0.5rem 0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.profile-key {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-dim);
  margin: 0.5rem 0 0 0;
  word-break: break-all;
}
/* Identity Section (in Profile tab) */
.identity-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.identity-section h3 {
  margin-bottom: 0.25rem;
  color: var(--text);
}

.public-key-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.75rem;
}

.public-key-box code {
  display: block;
  word-break: break-all;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.key-actions {
  display: flex;
  gap: 0.5rem;
}

.identity-meta {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
/* =========================================================================
   IDENTITY MANAGEMENT STYLES
   ========================================================================= */

.identity-management {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.data-section {
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.data-section h4 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.data-section p {
  margin-bottom: 0.75rem;
}

/* Identity list */
.identities-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.identity-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
}

.identity-info {
  flex: 1;
}

.identity-name {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.identity-key {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.identity-created {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.identity-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.identity-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.identity-actions {
  display: flex;
  gap: 0.5rem;
}

.create-identity-form {
  display: flex;
  gap: 0.5rem;
}

.create-identity-form .input {
  flex: 1;
}

/* Advanced section */
.identity-advanced {
  margin-top: 1rem;
}

.identity-advanced summary {
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.5rem;
}

.identity-advanced summary:hover {
  color: var(--text);
}

.identity-import-export {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Browser Identity Import/Export in Profile */
.identity-import-export {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.identity-import-export .data-section {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.identity-import-export .data-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
} /* end @layer profile */
