/* User Profile modal — scoped to #profile */

#profile .modal-dialog {
  max-width: min(440px, 100%);
  margin: 1.25rem auto;
}

#profile .modal-content {
  border: none;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

#profile .container-profile-modal {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
}

#profile .profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #eef0f4;
}

#profile .profile-modal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

#profile .profile-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #e1f4f7;
  color: #2e76ba;
}

#profile .profile-modal-icon .material-symbols-outlined {
  font-size: 22px;
}

#profile .profile-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

#profile .profile-modal-heading h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1c21;
  letter-spacing: -0.02em;
}

#profile .profile-modal-heading p {
  margin: 0;
  font-size: 0.8125rem;
  color: #8b93a7;
}

#profile .profile-modal-close {
  display: flex;
  align-items: flex-start;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

#profile .profile-modal-close-inner {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f8;
  color: #6b7280;
  transition: background 0.15s ease;
}

#profile .profile-modal-close:hover .profile-modal-close-inner {
  background: #e8eaef;
}

#profile .profile-modal-close .material-symbols-outlined {
  font-size: 20px;
}

#profile .profile-modal-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#profile .profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc 0%, #eef6ff 100%);
  border: 1px solid #e8edf5;
}

#profile .profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #dbeafe;
  color: #0c6af4;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#profile .profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#profile .profile-hero-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#profile .profile-hero-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  word-break: break-word;
}

#profile .profile-role-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
}

#profile .profile-username {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

#profile .profile-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#profile .profile-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

#profile .profile-detail-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #e1f4f7;
  color: #2e76ba;
}

#profile .profile-detail-icon .material-symbols-outlined {
  font-size: 20px;
}

#profile .profile-detail-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#profile .profile-detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

#profile .profile-detail-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
  word-break: break-word;
}

#profile .profile-detail-value.is-empty {
  color: #94a3b8;
  font-style: italic;
  font-weight: 400;
}

/* —— Dark mode —— */
html[data-theme="dark"] #profile .container-profile-modal {
  background: var(--rl-surface, #1e293b);
  border: 1px solid var(--rl-border, #334155);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] #profile .profile-modal-header {
  border-bottom-color: var(--rl-border, #334155);
  background: transparent;
}

html[data-theme="dark"] #profile .profile-modal-icon {
  background: rgba(46, 118, 186, 0.2);
  color: #7db3e8;
}

html[data-theme="dark"] #profile .profile-modal-heading h4 {
  color: var(--rl-ink, #f1f5f9);
}

html[data-theme="dark"] #profile .profile-modal-heading p {
  color: var(--rl-muted, #94a3b8);
}

html[data-theme="dark"] #profile .profile-modal-close-inner {
  background: #334155;
  color: var(--rl-muted, #94a3b8);
}

html[data-theme="dark"] #profile .profile-modal-close:hover .profile-modal-close-inner {
  background: #475569;
  color: var(--rl-ink, #f1f5f9);
}

html[data-theme="dark"] #profile .profile-hero {
  background: #0f172a;
  border-color: #334155;
}

html[data-theme="dark"] #profile .profile-hero-name {
  color: var(--rl-ink, #f1f5f9);
}

html[data-theme="dark"] #profile .profile-role-pill {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

html[data-theme="dark"] #profile .profile-username {
  color: var(--rl-muted, #94a3b8);
}

html[data-theme="dark"] #profile .profile-detail-row {
  background: #0f172a;
  border-color: #334155;
}

html[data-theme="dark"] #profile .profile-detail-icon {
  background: rgba(46, 118, 186, 0.2);
  color: #7db3e8;
}

html[data-theme="dark"] #profile .profile-detail-label {
  color: var(--rl-muted, #94a3b8);
}

html[data-theme="dark"] #profile .profile-detail-value {
  color: var(--rl-ink, #f1f5f9);
}

html[data-theme="dark"] #profile .profile-detail-value.is-empty {
  color: #64748b;
}

html[data-theme="dark"] #profile .profile-avatar {
  background: rgba(12, 106, 244, 0.2);
  color: #93c5fd;
}
