/* ============================================================================
   PROFILE CARD IMPROVEMENTS
   ============================================================================ */

.profile-card {
  max-width: 760px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 30px;
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3));
}

.profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-identity > div { min-width: 0; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px #ffffff30;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-identity .avatar { flex-basis: 52px; width: 52px; height: 52px; font-size: 19px; }
.avatar-tone-0 { background: #b64b45; }
.avatar-tone-1 { background: #8b5a9e; }
.avatar-tone-2 { background: #347b87; }
.avatar-tone-3 { background: #a16a35; }
.avatar-tone-4 { background: #4f719f; }
.avatar-tone-5 { background: #587d57; }

.message-author { display: inline-flex; align-items: center; gap: 8px; min-width: 0; vertical-align: middle; }
.message-author .avatar { flex-basis: 28px; width: 28px; height: 28px; font-size: 11px; }
.message-author b { overflow-wrap: anywhere; }

.profile-link,
.profile-link:visited { color: var(--red2); text-decoration: none; font-weight: 700; }
.profile-link:hover,
.profile-link:focus-visible,
.profile-link:active { color: var(--red-light); text-decoration: underline; }

.profile-card h3 {
  font: 600 clamp(24px, 4vw, 42px) Unbounded, Arial, sans-serif;
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
}

.profile-role {
  color: var(--red2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  background: rgba(228, 69, 49, 0.1);
  border-radius: var(--radius, 8px);
  border: 1px solid rgba(228, 69, 49, 0.3);
  white-space: nowrap;
}

.profile-date {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.profile-bio {
  margin: 16px 0 20px;
  padding: 16px 20px;
  background: var(--bg-elevated, #0d0f11);
  border-radius: var(--radius, 8px);
  border-left: 3px solid var(--accent, #ff6a3d);
  line-height: 1.7;
  white-space: pre-wrap;
}

.profile-empty {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  margin: 16px 0 20px;
  padding: 16px;
  text-align: center;
  background: var(--bg-elevated, #0d0f11);
  border: 1px dashed var(--line);
  border-radius: var(--radius, 8px);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stats div {
  padding: 18px;
  background: var(--bg-elevated, #0d0f10);
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  text-align: center;
  transition: var(--transition, 0.2s);
  cursor: default;
}

.profile-stats div:hover {
  border-color: var(--line-strong, #34393b);
  transform: translateY(-2px);
  background: var(--panel-hover, #15191b);
}

.profile-stats b {
  display: block;
  font: 700 32px Unbounded, Arial, sans-serif;
  color: var(--accent, #ff6a3d);
  margin-bottom: 8px;
  line-height: 1;
}

.profile-stats span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.profile-actions .btn {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  text-align: center;
}

.profile-setting-form + .profile-setting-form {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.profile-setting-form .btn { margin-top: 8px; }

.profile-heading {
  font-size: 16px;
  margin: 28px 0 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.profile-topics {
  border-top: 1px solid var(--line);
  max-height: 300px;
  overflow: auto;
  margin-top: 12px;
}

.profile-topic {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition, 0.2s);
}

.profile-topic:hover {
  background: var(--bg-elevated, #0d0f11);
  color: var(--accent, #ff6a3d);
  padding-left: 18px;
}

.profile-topic b {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.profile-topic small {
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
}

/* Mobile responsive */
@media (max-width: 780px) {
  .profile-card {
    padding: 20px;
  }

  .profile-card-head {
    flex-direction: column;
    gap: 12px;
  }

  .profile-identity { align-items: flex-start; }

  .profile-role {
    display: inline-block;
    margin-top: 8px;
  }

  .profile-stats {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
  }

  .profile-stats b {
    font-size: 24px;
  }

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

  .profile-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Light theme adjustments */
html[data-theme="light"] .profile-role {
  background: rgba(228, 69, 49, 0.08);
  border-color: rgba(228, 69, 49, 0.2);
}

html[data-theme="light"] .profile-bio {
  background: #f8f6f2;
}

html[data-theme="light"] .profile-empty {
  background: #f8f6f2;
}

html[data-theme="light"] .profile-stats div {
  background: #f8f6f2;
}

html[data-theme="light"] .profile-stats div:hover {
  background: #f1ede6;
}

html[data-theme="light"] .profile-topic:hover {
  background: #f8f6f2;
}
