/**
 * user_info.css
 *
 * UserWorker — full-screen profile page.
 * Apple HIG aesthetics. Single accent color (var(--accent)).
 * No cards. Endless grouped list rows like iOS Settings.
 * ThemeManager switches freely — zero hardcoded colors.
 */

/* ══════════════════════════════════════════════════════════════
   PAGE SHELL
══════════════════════════════════════════════════════════════ */
.up-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.up-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 24px);
}

/* ══════════════════════════════════════════════════════════════
   HERO — username + avatar + badge + inbox
══════════════════════════════════════════════════════════════ */
.up-hero {
  position: relative;
  padding: 28px 20px 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  border-bottom: 1px solid var(--separator);
}

/* Tinted gradient behind the hero — uses the single accent */
.up-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--accent) 14%, transparent) 0%,
    transparent 65%
  );
  pointer-events: none;
  border-radius: 0;
}

.up-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.up-hero-av {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  /* Crisp ring using accent */
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 5px var(--accent);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  overflow: hidden;
}

.up-hero-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Online dot */
.up-hero-online-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--success);
  border: 2.5px solid var(--bg);
  z-index: 2;
}

.up-hero-info {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.up-hero-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 5px;
}

.up-hero-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.up-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Inbox button — top-right of hero */
.up-inbox-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  flex-shrink: 0;
  transition: background .15s, transform .1s;
  margin-bottom: 2px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.up-inbox-btn:hover  { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.up-inbox-btn:active { transform: scale(.92); }

.up-inbox-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg);
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   STATUS ROW
══════════════════════════════════════════════════════════════ */
.up-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-bottom: 1px solid var(--separator);
}

.up-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 25%, transparent);
}

.up-status-text {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

/* ══════════════════════════════════════════════════════════════
   SECTION GROUPS  (iOS-Settings style)
══════════════════════════════════════════════════════════════ */
.up-section {
  margin-top: 28px;
  padding: 0 20px;
}

.up-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  padding-left: 2px;
}

/* The group of rows — no card bg, just subtle separator lines */
.up-group {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Each row inside the group */
.up-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  min-height: 50px;
  position: relative;
  transition: background .12s;
}

/* Separator — only between rows, not after last */
.up-row + .up-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--separator);
}

.up-row--tappable {
  cursor: pointer;
}
.up-row--tappable:hover  { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.up-row--tappable:active { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Row icon container */
.up-row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Row left label */
.up-row-label {
  flex: 1;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
}

/* Row sub-label (smaller, below label) */
.up-row-sub {
  font-size: .75rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* Row right value / control */
.up-row-value {
  font-size: .88rem;
  color: var(--text-tertiary);
  font-weight: 500;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* Chevron right */
.up-chevron {
  color: var(--text-tertiary);
  opacity: .5;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   DISTRICT BLOCK  (inside a group row, expanded)
══════════════════════════════════════════════════════════════ */
.up-district-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.up-district-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.up-district-meta {
  font-size: .75rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.up-district-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* District weather chip */
.up-weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 6px;
}
.up-weather-chip .wi-icon { font-size: .9rem; }

/* Map link */
.up-map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  margin-top: 4px;
  text-decoration: none;
  transition: background .12s;
}
.up-map-link:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

/* No district placeholder */
.up-no-district {
  font-size: .88rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   INLINE EDITABLE INPUT (row right side)
══════════════════════════════════════════════════════════════ */
.up-inline-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  border-bottom: 1.5px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: .9rem;
  font-weight: 600;
  text-align: right;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.up-inline-input:focus {
  border-bottom-color: var(--accent);
}
.up-inline-input::placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
}

/* readonly */
.up-inline-input--readonly {
  color: var(--text-tertiary);
  cursor: default;
  user-select: all;
}

/* ══════════════════════════════════════════════════════════════
   TOGGLE SWITCH
══════════════════════════════════════════════════════════════ */
.up-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.up-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.up-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  transition: background .2s;
  cursor: pointer;
}
.up-toggle input:checked + .up-toggle-track {
  background: var(--accent);
}
.up-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.up-toggle input:checked + .up-toggle-track::after {
  transform: translateX(20px);
}

/* ══════════════════════════════════════════════════════════════
   OPTION PILLS  (theme / language)
══════════════════════════════════════════════════════════════ */
.up-pill-row {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  flex-wrap: wrap;
  background: var(--bg-elevated);
  border-top: 1px solid var(--separator);
}

.up-pill-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  text-align: center;
  font-family: inherit;
  letter-spacing: .01em;
  white-space: nowrap;
}
.up-pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.up-pill-btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   DROPDOWN SELECT  (for theme / language in row)
══════════════════════════════════════════════════════════════ */
.up-select {
  padding: 6px 28px 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  transition: border-color .15s;
}
.up-select:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS  (primary / ghost / danger)
══════════════════════════════════════════════════════════════ */
.up-section-btn-wrap {
  padding: 0 20px;
  margin-top: 10px;
}

.up-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: opacity .15s, background .15s, border-color .15s, transform .1s;
  font-family: inherit;
  letter-spacing: .01em;
}
.up-btn:active { transform: scale(.98); opacity: .85; }

.up-btn--primary {
  background: var(--accent);
  color: #fff;
}
.up-btn--primary:hover { opacity: .88; }

.up-btn--ghost {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.up-btn--ghost:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.up-btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
}
.up-btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: var(--danger);
}

/* ══════════════════════════════════════════════════════════════
   MESSAGES SECTION
══════════════════════════════════════════════════════════════ */
.up-msg-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: .82rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.up-msg-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  transition: background .12s;
  cursor: pointer;
  position: relative;
}
.up-msg-item + .up-msg-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--separator);
}
.up-msg-item:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.up-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.up-msg-to {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  flex: 1;
}
.up-msg-time {
  font-size: .68rem;
  color: var(--text-tertiary);
}

.up-msg-body {
  font-size: .82rem;
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════════
   COMPOSE MESSAGE SHEET (inline inside group)
══════════════════════════════════════════════════════════════ */
.up-compose-wrap {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.up-compose-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* People picker autocomplete */
.up-people-picker {
  position: relative;
}
.up-people-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.up-people-input:focus { border-color: var(--accent); }

.up-people-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--popover-bg, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
}
.up-people-opt {
  padding: 10px 14px;
  font-size: .85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background .1s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.up-people-opt + .up-people-opt {
  border-top: 1px solid var(--separator);
}
.up-people-opt:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.up-people-opt-name { font-weight: 600; }
.up-people-opt-sub  { font-size: .72rem; color: var(--text-tertiary); }

.up-people-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
}
.up-people-chip-remove {
  display: flex;
  align-items: center;
  cursor: pointer;
  opacity: .6;
  transition: opacity .1s;
}
.up-people-chip-remove:hover { opacity: 1; }

.up-compose-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  font-size: .88rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  line-height: 1.5;
}
.up-compose-textarea:focus { border-color: var(--accent); }

.up-compose-send-row {
  display: flex;
  justify-content: flex-end;
}
.up-compose-send-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity .15s;
}
.up-compose-send-btn:hover   { opacity: .87; }
.up-compose-send-btn:disabled { opacity: .45; cursor: default; }

/* ══════════════════════════════════════════════════════════════
   LOADING PLACEHOLDER
══════════════════════════════════════════════════════════════ */
.up-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER SPACER
══════════════════════════════════════════════════════════════ */
.up-footer-space {
  height: 40px;
}
