/* ================================================================
   PROFILE PAGE STYLES
   ================================================================ */

.profile-page { background: var(--bg-primary); }

.profile-main {
  padding: 80px 0 40px;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Avatar ──────────────────────────────────────────────────────── */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 8px;
  gap: 12px;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-initials {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

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

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  line-height: 1;
}

.upload-progress {
  width: 180px;
}

.upload-bar {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.upload-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.upload-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
  text-align: center;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin: 0 16px;
  padding: 16px;
}

.profile-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.profile-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 8px 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s;
}

.profile-input:focus { border-color: var(--accent-primary); }

.profile-save-btn {
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.profile-static-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.profile-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Groups list ─────────────────────────────────────────────────── */
.profile-groups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-group-chip {
  display: inline-block;
  background: rgba(0,188,212,0.12);
  border: 1px solid rgba(0,188,212,0.3);
  color: var(--accent-primary);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.15s;
}

.profile-group-chip:hover { background: rgba(0,188,212,0.22); }

/* ── Logout ──────────────────────────────────────────────────────── */
.profile-logout-btn {
  margin: 4px 16px;
  width: calc(100% - 32px);
  padding: 12px;
  font-size: 0.9rem;
}

/* ── DM nav badge ────────────────────────────────────────────────── */
.dm-nav-btn {
  position: relative;
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px 8px;
  text-decoration: none;
  color: inherit;
}

.dm-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  background: var(--accent-primary);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Toast ───────────────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  white-space: nowrap;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Member post grid ---- */
.member-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.member-post-cell {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-card);
  display: block;
  position: relative;
  text-decoration: none;
}

.member-post-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-post-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.member-post-text-cell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
}

.member-post-skel {
  aspect-ratio: 1;
  background: var(--bg-card);
  animation: skel-pulse 1.4s ease-in-out infinite;
}

/* ---- Collections chips ---- */
.collections-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collection-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 188, 212, 0.1);
  border: 1px solid rgba(0, 188, 212, 0.25);
  font-size: 0.82rem;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.collection-chip:hover {
  background: rgba(0, 188, 212, 0.2);
}

/* ── Notification Settings ──────────────────────────────────────── */
.notif-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-setting-row:last-child {
  border-bottom: none;
}

.notif-setting-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 12px;
}

.notif-setting-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-setting-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}
