/* Page-scoped styles for the account profile (US2). Full-screen background
   (cover image or brand gradient), centered rounded avatar, action icons,
   then the content rails. Mobile-first. */

.account {
  position: relative;
  min-height: 100vh;
  padding-bottom: var(--space-10);
}

/* Full-screen background behind everything: cover image (dimmed) or gradient. */
.account__bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--home-gradient);
}
.account__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35);
}

/* Header: centered avatar, name, actions, over the background. */
.account__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-4) var(--space-6);
  text-align: center;
}

.account__avatar-link {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-pill);
}
.account__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 128px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--accent-blue);
  border: 3px solid var(--surface-0);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.account__avatar-img { width: 100%; height: 100%; object-fit: cover; }
.account__avatar-initials {
  font: 700 var(--text-display) / 1 var(--font-display);
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Hover affordance on the owner's editable avatar. */
.account__avatar-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-primary);
  font-size: var(--text-meta);
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.account__avatar-link:hover .account__avatar-edit,
.account__avatar-link:focus-visible .account__avatar-edit { opacity: 1; }

.account__name { font-size: var(--text-h1); display: inline-block; }
.account__name--editable { cursor: pointer; }
.account__name--editable:hover { color: var(--accent-blue-hov); }

/* Inline name edit (Turbo frame). */
.account__name-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}
.account__name-input {
  width: auto;
  min-width: 220px;
  text-align: center;
  font-size: var(--text-h2);
}
.account__name-save { padding: 10px 20px; }
.account__name-cancel { color: var(--text-tertiary); font-size: var(--text-meta); }
.account__name-cancel:hover { color: var(--text-primary); }

.account__actions {
  display: flex;
  gap: var(--space-3);
}
.account__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
}
.account__action:hover { border-color: var(--text-primary); color: var(--text-primary); }
/* Lock icon tints green while restricted content is unlocked this session (006). */
.account__action--lock.is-unlocked { color: var(--success); border-color: var(--success); }

/* PIN modal. */
.pin-modal__hint { color: var(--text-secondary); font-size: var(--text-meta); margin-bottom: var(--space-4); }
.pin-modal__status { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.pin-modal__status .icon { width: 20px; height: 20px; color: var(--success); }
.pin-modal__input { text-align: center; letter-spacing: 0.4em; font-size: var(--text-h3); }

.account__rails {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Playlist card: no artwork, a count badge on a surface tile. */
.playlist-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.playlist-card__count {
  font-size: var(--text-meta);
  font-weight: 600;
  color: var(--text-secondary);
}

.rail__empty {
  color: var(--text-tertiary);
  font-size: var(--text-meta);
  padding: var(--space-4) 0;
}

/* Playlists rail: create (+) button beside the title + empty state (feature 008). */
.rail__actions { display: flex; align-items: center; gap: var(--space-2); }
.rail__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
}
.rail__add:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.rail__add .icon { width: 18px; height: 18px; }
.rail__empty { color: var(--text-tertiary); font-size: var(--text-meta); padding: var(--space-4) 0; }

/* Playlist card delete (feature 008 delete): trash beside the title. */
.playlist-card-wrap { position: relative; }
.playlist-card__titlebar { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.playlist-card__titlelink {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-card__delete-form { flex: 0 0 auto; margin: 0; }
.playlist-card__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}
.playlist-card__delete:hover { color: var(--danger); background: var(--surface-2); }
.playlist-card__delete .icon { width: 16px; height: 16px; }
