/* =============================================
   Forum — profile.css
   Profile page, banner, stats, tabs
   ============================================= */

/* ── Banner ── */
.profile-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-3);
  display: block;
}

.profile-banner-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-3);
}

/* ── Profile Header ── */
.profile-header-bar {
  padding: 0 1rem;
}

.avatar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: -48px;
  margin-bottom: 0.75rem;
}

.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--bg-3);
}

.profile-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Profile Info ── */
.profile-info { padding: 0 1rem 1rem; }

.profile-display-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.profile-handle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Roblox verified chip */
.roblox-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  border: 1px solid rgba(29,155,240,0.3);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  margin-top: 0.4rem;
}
.roblox-chip svg { width: 12px; height: 12px; }

.profile-bio {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

/* ── Profile Stats ── */
.profile-stats {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
}

.stat {
  display: flex;
  gap: 0.3rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--dur);
}
.stat:hover { color: var(--text); }
.stat .count {
  font-weight: 700;
  color: var(--text);
}

/* ── Profile Tabs ── */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-top: 0.5rem;
}

.profile-tab {
  flex: 1;
  padding: 1rem 0;
  text-align: center;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--dur), background var(--dur);
}
.profile-tab:hover { background: rgba(231,233,234,0.06); color: var(--text); }
.profile-tab.active {
  color: var(--text);
  font-weight: 700;
}
.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 4px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* ── Settings / Edit Profile ── */
.settings-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.settings-row:last-child { border-bottom: none; }

.settings-row label { font-size: 0.9375rem; font-weight: 500; }
.settings-row .settings-desc { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Toggle switch */
.toggle {
  width: 44px; height: 26px;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: background var(--dur), border-color var(--dur);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--dur) var(--ease), background var(--dur);
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { transform: translateX(18px); background: #fff; }

/* ── Mobile profile adjustments ── */
@media (max-width: 599px) {
  .profile-banner,
  .profile-banner-placeholder { height: 140px; }

  /* Avatar negative margin scaled for shorter banner */
  .avatar-row { margin-top: -38px; }

  .profile-header-bar { padding: 0 0.875rem; }
  .profile-info        { padding: 0 0.875rem 1rem; }

  /* Wrap follow/edit buttons if there are several */
  .profile-actions { flex-wrap: wrap; gap: 0.4rem; }

  /* Stats can scroll horizontally on very narrow screens */
  .profile-stats { flex-wrap: wrap; gap: 0.6rem 1rem; }

  /* Profile display name */
  .profile-display-name { font-size: 1.1rem; }

  /* Profile tabs — scrollable and sticky below mobile header */
  .profile-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 53px;
    background: var(--bg);
    z-index: 100;
  }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .profile-tab  { flex-shrink: 0; font-size: 0.875rem; }
}

/* ── Banner upload preview ── */
.banner-upload-area {
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
  overflow: hidden;
  position: relative;
}
.banner-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.banner-upload-area img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.banner-upload-area .upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur);
}
.banner-upload-area:hover .upload-overlay { opacity: 1; }
