/**
 * Profile Page – Enterprise-Grade UI & UX
 * Restructured: semantic blocks (profile__hero, profile__identity, profile__actions,
 * profile__sidebar, profile__main). Design system: tokens, elevation, typography, buttons, icons.
 */

/* ==========================================================================
   1. DESIGN TOKENS – Glossy / Advanced UI
   ========================================================================== */
:root {
  /* Icon scale – larger, clearer */
  --profile-icon-xs: 18px;
  --profile-icon-sm: 20px;
  --profile-icon-md: 22px;
  --profile-icon-lg: 24px;
  --profile-icon-xl: 26px;
  /* Spacing scale (4px base) */
  --profile-space-1: 4px;
  --profile-space-2: 8px;
  --profile-space-3: 12px;
  --profile-space-4: 16px;
  --profile-space-5: 20px;
  --profile-space-6: 24px;
  /* Radius */
  --profile-radius-sm: 10px;
  --profile-radius-md: 14px;
  --profile-radius-lg: 18px;
  --profile-radius-xl: 22px;
  --profile-radius-pill: 9999px;
  /* Elevation – softer, more depth */
  --profile-elevation-1: 0 2px 6px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --profile-elevation-2: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --profile-elevation-3: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --profile-elevation-4: 0 12px 32px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.05);
  /* Surface */
  --profile-surface: #ffffff;
  --profile-surface-hover: #f5f7fc;
  --profile-border: rgba(0, 0, 0, 0.07);
  --profile-border-strong: rgba(0, 0, 0, 0.1);
  --profile-ink: rgba(0, 0, 0, 0.06);
  --profile-ink-muted: rgba(0, 0, 0, 0.5);
  /* Glossy overlays */
  --profile-gloss-top: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 50%);
  --profile-gloss-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 255, 0.95) 100%);
  --profile-shine: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  /* Primary (from theme) */
  --profile-primary: var(--link-color);
  --profile-primary-hover: rgba(94, 114, 228, 0.12);
  --profile-primary-active: rgba(94, 114, 228, 0.18);
  /* Buttons */
  --profile-btn-height-md: 42px;
  --profile-btn-height-sm: 38px;
  --profile-btn-font: 600;
  --profile-btn-radius: var(--profile-radius-pill);
}

body.night-mode {
  --profile-surface: var(--card-dark-color);
  --profile-surface-hover: var(--card-dark-hover);
  --profile-border: var(--card-dark-divider);
  --profile-border-strong: rgba(255, 255, 255, 0.12);
  --profile-ink: rgba(0, 0, 0, 0.2);
  --profile-ink-muted: rgba(255, 255, 255, 0.6);
  --profile-primary-hover: rgba(94, 114, 228, 0.2);
  --profile-primary-active: rgba(94, 114, 228, 0.28);
  --profile-gloss-card: var(--card-dark-color);
  --profile-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.2);
  --profile-elevation-2: 0 2px 8px rgba(0, 0, 0, 0.25);
  --profile-elevation-3: 0 4px 16px rgba(0, 0, 0, 0.3);
  --profile-elevation-4: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
  .profile-page .profile-header,
  .profile-page .profile__hero,
  .profile-page .profile__identity,
  .profile-page .profile__actions,
  .profile-page .profile-tabs-wrapper,
  .profile-page .profile-content-row,
  .profile-page .profile__sidebar .card,
  .sg-offcanvas-mainbar .profile-header,
  .sg-offcanvas-mainbar .profile-tabs-wrapper,
  .profile-content-row .profile-left-panel .card,
  .profile-stats-strip .profile-stat-item,
  .profile-cover-wrapper img,
  .profile-avatar-wrapper img,
  .profile-buttons-wrapper .btn,
  .profile-tabs-wrapper a,
  .circled-user-box .user-box,
  .about-list-item {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   3. PROFILE PAGE STRUCTURE (semantic blocks)
   .profile-page = main column wrapper
   .profile__hero = cover section
   .profile__identity = avatar + name + badges
   .profile__actions = buttons + stats strip
   .profile__sidebar = left column (cards, about)
   .profile__main = right column (timeline)
   ========================================================================== */

/* Ensure SVG icons are visible – container and inner svg */
.profile-page .svg-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.profile-page .svg-container svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  fill: currentColor;
}

/* ==========================================================================
   4. PAGE ENTRANCE ANIMATIONS
   ========================================================================== */
@keyframes profileHeaderEnter {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes profileContentEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes profileCardStagger {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sg-offcanvas-mainbar .profile-header {
  animation: profileHeaderEnter 0.5s ease-out both;
}

.sg-offcanvas-mainbar .profile-tabs-wrapper {
  animation: profileContentEnter 0.45s ease-out 0.08s both;
}

.profile-content-row {
  animation: profileContentEnter 0.5s ease-out 0.12s both;
}

/* Staggered cards in left panel */
.profile-left-panel .card {
  animation: profileCardStagger 0.45s ease-out both;
}

.profile-left-panel .card:nth-child(1) { animation-delay: 0.18s; }
.profile-left-panel .card:nth-child(2) { animation-delay: 0.24s; }
.profile-left-panel .card:nth-child(3) { animation-delay: 0.30s; }
.profile-left-panel .card:nth-child(4) { animation-delay: 0.36s; }
.profile-left-panel .card:nth-child(5) { animation-delay: 0.42s; }
.profile-left-panel .card:nth-child(6) { animation-delay: 0.48s; }
.profile-left-panel .card:nth-child(7) { animation-delay: 0.54s; }
.profile-left-panel .card:nth-child(8) { animation-delay: 0.60s; }
.profile-left-panel .card:nth-child(9) { animation-delay: 0.66s; }
.profile-left-panel .card:nth-child(10) { animation-delay: 0.72s; }
.profile__sidebar .card { animation: profileCardStagger 0.45s ease-out both; }
.profile__sidebar .card:nth-child(1) { animation-delay: 0.18s; }
.profile__sidebar .card:nth-child(2) { animation-delay: 0.24s; }
.profile__sidebar .card:nth-child(3) { animation-delay: 0.30s; }
.profile__sidebar .card:nth-child(4) { animation-delay: 0.36s; }
.profile__sidebar .card:nth-child(5) { animation-delay: 0.42s; }
.profile__sidebar .card:nth-child(6) { animation-delay: 0.48s; }
.profile__sidebar .card:nth-child(7) { animation-delay: 0.54s; }
.profile__sidebar .card:nth-child(8) { animation-delay: 0.60s; }
.profile__sidebar .card:nth-child(9) { animation-delay: 0.66s; }
.profile__sidebar .card:nth-child(10) { animation-delay: 0.72s; }

/* ==========================================================================
   5. PROFILE HEADER (card: hero + identity + actions) – Glossy
   ========================================================================== */
.profile-header {
  background: var(--profile-gloss-card);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius-lg);
  box-shadow: var(--profile-elevation-2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: visible;
  margin-bottom: var(--profile-space-4) !important;
  position: relative;
}
.profile-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: var(--profile-radius-lg) var(--profile-radius-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

body.night-mode .profile-header {
  background: var(--profile-surface);
  box-shadow: var(--profile-elevation-3);
}
body.night-mode .profile-header::before {
  opacity: 0.15;
}

@media (min-width: 992px) {
  .profile-header {
    margin-bottom: var(--profile-space-5) !important;
  }
}

/* ---------- 5.1 Hero (cover) ---------- */
.profile__hero {
  display: block;
}
.profile-cover-wrapper {
  position: relative;
  transition: height 0.3s ease;
  border-radius: var(--profile-radius-lg) var(--profile-radius-lg) 0 0;
  overflow: hidden;
}

.profile-cover-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 35%, rgba(0, 0, 0, 0.06) 65%, rgba(0, 0, 0, 0.22) 100%);
  pointer-events: none;
}

.profile-cover-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.08) 0%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.profile-cover-wrapper img.js_position-cover-cropped {
  transition: transform 0.4s ease;
}

.profile-cover-wrapper:hover img.js_position-cover-cropped {
  transform: scale(1.02);
}

/* Cover action buttons – enterprise floating actions */
.profile-cover-buttons > div {
  border-radius: var(--profile-radius-pill);
  padding: var(--profile-space-2) var(--profile-space-3);
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-elevation-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--profile-space-1);
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.profile-cover-buttons > div:hover {
  background: var(--profile-surface-hover);
  box-shadow: var(--profile-elevation-3);
  transform: translateY(-1px);
}

body.night-mode .profile-cover-buttons > div {
  background: var(--card-dark-hover);
  border-color: var(--profile-border);
  color: var(--body-color-dark);
}

.profile-cover-buttons .svg-container {
  flex-shrink: 0;
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: #fff;
  fill: currentColor;
}

.profile-cover-buttons > div.dropdown {
  display: inline-block;
}

.profile-cover-change,
.profile-avatar-change {
  cursor: pointer;
}

/* ---------- 5.2 Identity (avatar + name + badges) ---------- */
/* Do not set position on profile__identity – avatar uses position:absolute relative to profile-header */
.profile__identity {
  display: block;
}
/* Do not override position – base theme uses position: absolute to place avatar over cover */
.profile-avatar-wrapper {
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--profile-elevation-2), 0 0 0 1px var(--profile-border), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  z-index: 10;
  overflow: hidden;
  border-radius: 50%;
}

.profile-avatar-wrapper:not(.profile-avatar-has-story) {
  overflow: hidden;
  border-radius: 50%;
}

body.night-mode .profile-avatar-wrapper {
  border-color: var(--card-dark-color);
  box-shadow: var(--profile-elevation-3), 0 0 0 1px var(--profile-border);
}

.profile-avatar-wrapper:hover {
  box-shadow: var(--profile-elevation-3), 0 0 0 2px var(--profile-primary);
}

/* Ensure profile picture image is visible and not clipped */
.profile-avatar-wrapper img {
  display: block !important;
  object-fit: cover !important;
  border-radius: 50%;
  transition: transform 0.3s ease;
  background: transparent;
}

/* Keep responsive avatar sizes from base theme; ensure box model doesn’t clip */
.profile-avatar-wrapper:not(.profile-avatar-has-story) img {
  box-sizing: border-box;
}

.profile-avatar-wrapper:hover img {
  transform: scale(1.03);
}

/* View story button – ensure visible below story ring (when profile has story) */
.profile-avatar-wrapper.profile-avatar-has-story .profile-view-story-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

/* Avatar action buttons – enterprise icon buttons (always visible, clickable) */
.profile-avatar-change,
.profile-avatar-crop,
.profile-avatar-delete {
  padding: var(--profile-space-2);
  border-radius: 50%;
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-elevation-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.profile-avatar-change:hover,
.profile-avatar-crop:hover,
.profile-avatar-delete:hover {
  background: var(--profile-surface-hover);
  box-shadow: var(--profile-elevation-3);
}

.profile-avatar-change .svg-container,
.profile-avatar-crop .svg-container,
.profile-avatar-delete .svg-container {
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: var(--profile-ink-muted);
  fill: currentColor;
}

.profile-avatar-change:hover .svg-container,
.profile-avatar-crop:hover .svg-container,
.profile-avatar-delete:hover .svg-container {
  color: var(--profile-primary);
  fill: currentColor;
}

/* ========== Name & badges – enterprise typography ========== */
.profile-name-wrapper {
  padding-top: var(--profile-space-4);
  padding-bottom: var(--profile-space-3);
}

.profile-name-wrapper a:first-of-type {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
  transition: color 0.2s ease;
}

.profile-name-wrapper a:first-of-type:hover {
  color: rgba(255, 255, 255, 0.9);
}

.profile-name-wrapper .verified-badge,
.profile-name-wrapper .package-badge {
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.profile-name-wrapper .verified-badge:hover,
.profile-name-wrapper .package-badge:hover {
  transform: scale(1.05);
}

@media (min-width: 992px) {
  .profile-name-wrapper a:first-of-type {
    font-size: 1.75rem;
  }
}

/* ---------- 5.3 Actions (buttons + stats strip) ---------- */
.profile__actions {
  display: block;
}
.profile-stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--profile-space-2) var(--profile-space-3);
  padding: var(--profile-space-4) var(--profile-space-5);
  border-top: 1px solid var(--profile-border);
  background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 255, 0.4) 100%);
}

.profile-stat-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.75rem;
  padding: var(--profile-space-3) var(--profile-space-4);
  border-radius: var(--profile-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.profile-stat-item:hover {
  background: var(--profile-primary-hover);
  color: var(--profile-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.profile-stat-item.active {
  background: var(--profile-primary-hover);
  color: var(--profile-primary);
  font-weight: var(--profile-btn-font);
}

.profile-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.profile-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--profile-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.profile-stat-sep {
  width: 1px;
  height: 24px;
  background: var(--profile-border);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .profile-stats-strip {
    padding: var(--profile-space-3) var(--profile-space-5);
    gap: var(--profile-space-2);
  }
  .profile-stat-item {
    min-width: 4rem;
    padding: var(--profile-space-2) var(--profile-space-4);
  }
  .profile-stat-value {
    font-size: 1.25rem;
  }
  .profile-stat-label {
    font-size: 0.75rem;
  }
  .profile-stat-sep {
    height: 28px;
  }
}
.profile-buttons-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--profile-space-2);
  padding-bottom: var(--profile-space-4);
}

@media (min-width: 992px) {
  .profile-buttons-wrapper {
    justify-content: flex-start;
  }
}

/* Primary (filled) */
.profile-buttons-wrapper .btn-primary,
.profile-buttons-wrapper .btn-success {
  min-height: var(--profile-btn-height-md);
  padding: 0 var(--profile-space-5);
  font-weight: var(--profile-btn-font);
  font-size: 0.875rem;
  border-radius: var(--profile-btn-radius);
  border: none;
  box-shadow: var(--profile-elevation-1), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.profile-buttons-wrapper .btn-primary:hover,
.profile-buttons-wrapper .btn-success:hover {
  box-shadow: var(--profile-elevation-2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.profile-buttons-wrapper .btn-primary:active,
.profile-buttons-wrapper .btn-success:active {
  transform: translateY(0);
}

/* Secondary / ghost (outline style) – glossy */
.profile-buttons-wrapper .btn-light {
  min-height: var(--profile-btn-height-md);
  padding: 0 var(--profile-space-5);
  font-weight: var(--profile-btn-font);
  font-size: 0.875rem;
  border-radius: var(--profile-btn-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, var(--profile-surface-hover) 100%) !important;
  border: 1px solid var(--profile-border) !important;
  color: inherit !important;
  box-shadow: var(--profile-elevation-1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.profile-buttons-wrapper .btn-light:hover {
  background: var(--profile-surface-hover) !important;
  border-color: var(--profile-border-strong) !important;
  box-shadow: var(--profile-elevation-2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.profile-buttons-wrapper .btn-danger {
  min-height: var(--profile-btn-height-md);
  padding: 0 var(--profile-space-5);
  font-weight: var(--profile-btn-font);
  border-radius: var(--profile-btn-radius);
  box-shadow: var(--profile-elevation-1);
}

/* Icon-only buttons */
.profile-buttons-wrapper .btn-icon {
  width: var(--profile-btn-height-md);
  height: var(--profile-btn-height-md);
  min-width: var(--profile-btn-height-md);
  min-height: var(--profile-btn-height-md);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.profile-buttons-wrapper a.btn-rounded {
  width: var(--profile-btn-height-md);
  height: var(--profile-btn-height-md);
  min-width: var(--profile-btn-height-md);
  min-height: var(--profile-btn-height-md);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Focus – enterprise focus ring */
.profile-buttons-wrapper .btn:focus-visible,
.profile-buttons-wrapper a:focus-visible {
  outline: 2px solid var(--profile-primary);
  outline-offset: 2px;
}

/* Icon sizing – larger (22px) in buttons */
.profile-buttons-wrapper .btn .svg-container {
  vertical-align: middle;
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
}

.profile-buttons-wrapper .btn-success .svg-container,
.profile-buttons-wrapper .btn-success .svg-container svg,
.profile-buttons-wrapper .btn-primary .svg-container,
.profile-buttons-wrapper .btn-primary .svg-container svg,
.profile-buttons-wrapper .btn-danger .svg-container,
.profile-buttons-wrapper .btn-danger .svg-container svg {
  color: #fff;
  fill: currentColor;
}

.profile-buttons-wrapper .btn-light .svg-container,
.profile-buttons-wrapper .btn-light .svg-container svg {
  color: var(--profile-ink-muted);
  fill: currentColor;
}

.profile-buttons-wrapper .btn-light:hover .svg-container,
.profile-buttons-wrapper .btn-light:hover .svg-container svg {
  color: var(--profile-primary);
  fill: currentColor;
}

/* ==========================================================================
   6. PROFILE TABS (navigation) – Glossy, larger icons
   ========================================================================== */
.profile-tabs-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--profile-space-2);
  padding: var(--profile-space-3) var(--profile-space-4);
  border-radius: var(--profile-radius-md);
  background: var(--profile-gloss-card);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-elevation-1), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
}
body.night-mode .profile-tabs-wrapper {
  box-shadow: var(--profile-elevation-1);
}

.profile-tabs-wrapper a {
  display: inline-flex;
  align-items: center;
  gap: var(--profile-space-2);
  padding: var(--profile-space-3) var(--profile-space-4);
  border-radius: var(--profile-radius-sm);
  font-weight: var(--profile-btn-font);
  font-size: 0.875rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  position: relative;
  color: var(--profile-ink-muted);
}

.profile-tabs-wrapper a:hover {
  background: var(--profile-primary-hover);
  color: var(--profile-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.profile-tabs-wrapper a:active {
  transform: scale(0.98);
}

.profile-tabs-wrapper a.active {
  background: var(--profile-primary-hover);
  color: var(--profile-primary);
  border-bottom: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.profile-tabs-wrapper a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: var(--profile-radius-pill);
  background: var(--profile-primary);
  box-shadow: 0 0 8px rgba(94, 114, 228, 0.4);
}

/* Tab icons – larger (22px) */
.profile-tabs-wrapper a .svg-container {
  flex-shrink: 0;
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: inherit;
  fill: currentColor;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.profile-tabs-wrapper a:hover .svg-container,
.profile-tabs-wrapper a.active .svg-container {
  opacity: 1;
}

.profile-tabs-wrapper a:focus-visible {
  outline: 2px solid var(--profile-primary);
  outline-offset: 2px;
}

.sg-offcanvas-mainbar .profile-tabs-wrapper {
  margin-bottom: var(--profile-space-4) !important;
}

/* ==========================================================================
   7. PROFILE CONTENT – SIDEBAR (left column: cards, about, widgets)
   ========================================================================== */
.sg-offcanvas-mainbar .col-lg-4 .card,
.sg-offcanvas-mainbar .profile__sidebar .card {
  border-radius: var(--profile-radius-md);
  border: 1px solid var(--profile-border);
  background: var(--profile-gloss-card);
  box-shadow: var(--profile-elevation-1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
  margin-bottom: var(--profile-space-3);
  position: relative;
  overflow: hidden;
}
body.night-mode .sg-offcanvas-mainbar .col-lg-4 .card,
body.night-mode .sg-offcanvas-mainbar .profile__sidebar .card {
  box-shadow: var(--profile-elevation-1);
}

.sg-offcanvas-mainbar .col-lg-4 .card::before,
.sg-offcanvas-mainbar .profile__sidebar .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  pointer-events: none;
}
body.night-mode .sg-offcanvas-mainbar .col-lg-4 .card::before,
body.night-mode .sg-offcanvas-mainbar .profile__sidebar .card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

.sg-offcanvas-mainbar .col-lg-4 .card:last-child,
.sg-offcanvas-mainbar .profile__sidebar .card:last-child {
  margin-bottom: 0;
}

.sg-offcanvas-mainbar .col-lg-4 .card:hover,
.sg-offcanvas-mainbar .profile__sidebar .card:hover {
  box-shadow: var(--profile-elevation-2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
  border-color: var(--profile-border-strong);
}
body.night-mode .sg-offcanvas-mainbar .col-lg-4 .card:hover,
body.night-mode .sg-offcanvas-mainbar .profile__sidebar .card:hover {
  box-shadow: var(--profile-elevation-2);
}

.sg-offcanvas-mainbar .col-lg-4 .card:focus-within,
.sg-offcanvas-mainbar .profile__sidebar .card:focus-within {
  box-shadow: var(--profile-elevation-2);
  outline: 2px solid var(--profile-primary);
  outline-offset: 2px;
  border-color: transparent;
}

.sg-offcanvas-mainbar .col-lg-4 .card .card-header,
.sg-offcanvas-mainbar .profile__sidebar .card .card-header {
  font-weight: 700;
  font-size: 1rem;
  padding: var(--profile-space-4) var(--profile-space-5);
  border-bottom: 1px solid var(--profile-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
}
body.night-mode .sg-offcanvas-mainbar .col-lg-4 .card .card-header,
body.night-mode .sg-offcanvas-mainbar .profile__sidebar .card .card-header {
  background: transparent;
}

.sg-offcanvas-mainbar .col-lg-4 .card .card-header .svg-container,
.sg-offcanvas-mainbar .profile__sidebar .card .card-header .svg-container {
  vertical-align: middle;
  margin-right: var(--profile-space-3);
  width: var(--profile-icon-lg) !important;
  height: var(--profile-icon-lg) !important;
  min-width: var(--profile-icon-lg);
  min-height: var(--profile-icon-lg);
  color: var(--profile-primary);
  fill: var(--profile-primary);
}

.sg-offcanvas-mainbar .col-lg-4 .card .card-body,
.sg-offcanvas-mainbar .profile__sidebar .card .card-body {
  padding: var(--profile-space-4);
}

/* ---------- 7.1 About / Bio section card ---------- */
.profile-about-card .card-body {
  padding: var(--profile-space-5);
}

/* Bio block – glossy, clear typography */
.profile-left-panel .about-bio,
.profile__sidebar .about-bio {
  margin-bottom: var(--profile-space-5);
  padding: var(--profile-space-5);
  padding-left: var(--profile-space-6);
  border-left: 4px solid var(--profile-primary);
  border-radius: 0 var(--profile-radius-md) var(--profile-radius-md) 0;
  background: linear-gradient(135deg, rgba(248, 250, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--profile-ink);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

body.night-mode .profile-left-panel .about-bio,
body.night-mode .profile__sidebar .about-bio {
  background: var(--profile-primary-hover);
  box-shadow: none;
}

.profile-left-panel .about-bio .js_readmore,
.profile__sidebar .about-bio .js_readmore {
  min-height: 0;
  color: inherit;
}

.profile-left-panel .about-bio a,
.profile__sidebar .about-bio a {
  color: var(--profile-primary);
  text-decoration: none;
  font-weight: 500;
}
.profile-left-panel .about-bio a:hover,
.profile__sidebar .about-bio a:hover {
  text-decoration: underline;
}

/* Divider between bio and list */
.profile-left-panel .about-bio + .about-list,
.profile__sidebar .about-bio + .about-list {
  padding-top: var(--profile-space-4);
  margin-top: 0;
  border-top: 1px solid var(--profile-border);
}

/* About list – clean rows */
.profile-left-panel .about-list,
.profile__sidebar .about-list {
  padding-left: 0;
  margin-bottom: 0;
  margin-left: 0;
  list-style: none;
}

.profile-left-panel .about-list li,
.profile__sidebar .about-list li {
  list-style: none;
  position: static;
  margin-bottom: 0;
}

.about-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--profile-space-4);
  padding: var(--profile-space-4) var(--profile-space-4);
  margin-bottom: var(--profile-space-2);
  border-radius: var(--profile-radius-sm);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  word-break: break-word;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: inherit;
}

.about-list-item:last-child {
  margin-bottom: 0;
}

.about-list-item:hover {
  background: var(--profile-primary-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* About list icons – larger (22px), glossy pill */
.about-list-item .svg-container {
  position: static !important;
  flex-shrink: 0;
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--profile-space-3);
  border-radius: var(--profile-radius-sm);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, var(--profile-primary-hover) 100%);
  color: var(--profile-primary);
  fill: var(--profile-primary);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.about-list-item:hover .svg-container {
  background: linear-gradient(145deg, var(--profile-primary-hover) 0%, var(--profile-primary-active) 100%);
  box-shadow: 0 2px 4px rgba(94, 114, 228, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.night-mode .about-list-item .svg-container {
  background: var(--profile-primary-active);
}

/* Text/content beside icon */
.about-list-item > *:not(.svg-container) {
  flex: 1;
  min-width: 0;
}

.about-list-item .details {
  margin-top: var(--profile-space-1);
  font-size: 0.8125rem;
  color: var(--profile-ink-muted);
}

.about-list-item a {
  color: var(--profile-primary);
  text-decoration: none;
  font-weight: 500;
}
.about-list-item a:hover {
  text-decoration: underline;
}

.about-list-item .text-info {
  color: var(--profile-primary) !important;
  font-weight: 500;
}

/* ---------- 7.2 Profile completion panel ---------- */
.profile-header + .profile-tabs-wrapper + .row .card .card-header .progress,
.profile-header ~ * .card .progress.mt5,
.profile-left-panel .card .card-header .progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--profile-ink);
}

body.night-mode .profile-left-panel .card .card-header .progress {
  background: var(--card-dark-divider);
}

.profile-header + .profile-tabs-wrapper + .row .card .progress-bar-info,
.profile-header ~ * .card .progress-bar-striped,
.profile-left-panel .card .progress-bar {
  border-radius: var(--profile-radius-pill);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-left-panel .card .card-header.bg-transparent {
  padding-bottom: 0.5rem;
}

.profile-left-panel .card .card-header .float-end {
  font-weight: 700;
  color: var(--profile-primary);
  font-size: 0.9375rem;
}

/* Profile completion checklist items */
.card-body .mb5 a,
.card-body .mb5 .text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.card-body .mb5 a:hover,
.card-body .mb5 .text-link:hover {
  background: rgba(94, 114, 228, 0.08);
}

.card-body .mb5 .fa-plus-circle,
.card-body .mb5 .fa-check-circle {
  width: 1.1em;
  text-align: center;
}

/* Completed checklist items – green check */
.card-body .mb5 .svg-container.green,
.card-body .mb5 .svg-container.green svg {
  color: #28a745;
  fill: #28a745;
}

body.night-mode .card-body .mb5 .svg-container.green,
body.night-mode .card-body .mb5 .svg-container.green svg {
  color: #3dd16a;
  fill: #3dd16a;
}


/* ---------- 7.4 Merits panel ---------- */
.merit-dashboard-panel .merit-panel-header .merit-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.merit-dashboard-panel .merit-panel-header .merit-panel-icon .svg-container {
  width: var(--profile-icon-lg) !important;
  height: var(--profile-icon-lg) !important;
  min-width: var(--profile-icon-lg);
  min-height: var(--profile-icon-lg);
  color: var(--link-color);
  fill: var(--link-color);
}

.merit-dashboard-panel .merit-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.merit-dashboard-panel .merit-stat-icon .svg-container {
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: var(--link-color);
  fill: var(--link-color);
}

.merit-dashboard-panel .merit-panel-actions .svg-container {
  width: var(--profile-icon-sm) !important;
  height: var(--profile-icon-sm) !important;
  color: #fff;
  fill: currentColor;
}

/* ---------- 7.5 Subscribe / Tip / Gift CTAs ---------- */
.sg-offcanvas-mainbar .col-lg-4 .d-grid,
.sg-offcanvas-mainbar .profile__sidebar .d-grid {
  margin-bottom: var(--profile-space-3);
}

.sg-offcanvas-mainbar .col-lg-4 .d-grid .btn.rounded-pill,
.sg-offcanvas-mainbar .col-lg-4 .d-grid .btn.rounded,
.sg-offcanvas-mainbar .profile__sidebar .d-grid .btn.rounded-pill,
.sg-offcanvas-mainbar .profile__sidebar .d-grid .btn.rounded {
  min-height: var(--profile-btn-height-md);
  font-weight: var(--profile-btn-font);
  font-size: 0.875rem;
  padding: 0 var(--profile-space-5);
  border-radius: var(--profile-btn-radius);
  box-shadow: var(--profile-elevation-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sg-offcanvas-mainbar .col-lg-4 .d-grid .btn.rounded-pill:hover,
.sg-offcanvas-mainbar .col-lg-4 .d-grid .btn.rounded:hover,
.sg-offcanvas-mainbar .profile__sidebar .d-grid .btn.rounded-pill:hover,
.sg-offcanvas-mainbar .profile__sidebar .d-grid .btn.rounded:hover {
  transform: translateY(-1px);
  box-shadow: var(--profile-elevation-3);
}

.sg-offcanvas-mainbar .col-lg-4 .d-grid .btn .svg-container,
.sg-offcanvas-mainbar .profile__sidebar .d-grid .btn .svg-container {
  vertical-align: middle;
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: #fff;
  fill: currentColor;
}

/* ---------- 7.6 Social links ---------- */
.btn-icon-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--profile-radius-sm);
  margin: 0 var(--profile-space-1);
  transition: background 0.2s ease, transform 0.2s ease;
  background: var(--profile-surface-hover);
  border: 1px solid var(--profile-border);
}

.btn-icon-social:hover {
  background: var(--profile-primary-hover);
  border-color: var(--profile-border-strong);
  transform: scale(1.05);
}

.btn-icon-social .svg-container {
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: var(--profile-ink-muted);
  fill: currentColor;
}

.btn-icon-social:hover .svg-container {
  color: var(--profile-primary);
  fill: currentColor;
}

/* ---------- 7.7 Search card ---------- */
.profile-left-panel .card form .input-group .form-control,
.profile__sidebar .card form .input-group .form-control {
  border-radius: var(--profile-radius-sm) 0 0 var(--profile-radius-sm);
  font-size: 0.875rem;
  padding: var(--profile-space-2) var(--profile-space-3);
  border-color: var(--profile-border);
}

.profile-left-panel .card form .input-group .btn-primary,
.profile__sidebar .card form .input-group .btn-primary {
  border-radius: 0 var(--profile-radius-sm) var(--profile-radius-sm) 0;
  font-weight: var(--profile-btn-font);
  font-size: 0.875rem;
  padding: var(--profile-space-2) var(--profile-space-4);
}

/* ---------- 7.8 Friends / Photos grid ---------- */
.profile-left-panel .card-body.ptb10,
.profile__sidebar .card-body.ptb10 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.circled-user-box .user-box {
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.circled-user-box .user-box .name {
  font-size: 0.75rem;
  line-height: 1.25;
}

.circled-user-box .user-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.circled-user-box .user-box img {
  transition: transform 0.3s ease;
}

.circled-user-box .user-box:hover img {
  transform: scale(1.05);
}

/* ========== Dropdown menu – enterprise ========== */
.profile-avatar-wrapper .dropdown-menu,
.profile-header .dropdown-menu {
  z-index: 1050;
}
.profile-buttons-wrapper .dropdown-menu.action-dropdown-menu,
.profile-avatar-wrapper .dropdown-menu.action-dropdown-menu {
  border-radius: var(--profile-radius-md);
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-elevation-4);
  padding: var(--profile-space-2);
  min-width: 220px;
}

.profile-buttons-wrapper .dropdown-menu .dropdown-item,
.profile-avatar-wrapper .dropdown-menu .dropdown-item {
  border-radius: var(--profile-radius-sm);
  padding: var(--profile-space-2) var(--profile-space-3);
  transition: background 0.15s ease;
  font-size: 0.875rem;
}

.profile-buttons-wrapper .dropdown-menu .dropdown-item:hover,
.profile-avatar-wrapper .dropdown-menu .dropdown-item:hover {
  background: var(--profile-surface-hover);
}

.profile-buttons-wrapper .dropdown-menu .dropdown-item .action,
.profile-avatar-wrapper .dropdown-menu .dropdown-item .action {
  font-weight: 500;
}

.profile-buttons-wrapper .dropdown-menu .dropdown-item .action-desc,
.profile-avatar-wrapper .dropdown-menu .dropdown-item .action-desc {
  font-size: 0.75rem;
  color: var(--profile-ink-muted);
  margin-top: 2px;
}

.profile-buttons-wrapper .dropdown-menu .dropdown-item .action .svg-container,
.profile-avatar-wrapper .dropdown-menu .dropdown-item .action .svg-container {
  vertical-align: middle;
  width: var(--profile-icon-md) !important;
  height: var(--profile-icon-md) !important;
  min-width: var(--profile-icon-md);
  min-height: var(--profile-icon-md);
  color: var(--profile-primary);
  fill: var(--profile-primary);
}

.profile-buttons-wrapper .dropdown-menu .dropdown-divider,
.profile-avatar-wrapper .dropdown-menu .dropdown-divider {
  margin: var(--profile-space-2) 0;
  border-color: var(--profile-border);
}

.profile-buttons-wrapper .dropdown-menu .dropdown-item:focus-visible,
.profile-avatar-wrapper .dropdown-menu .dropdown-item:focus-visible {
  outline: 2px solid var(--profile-primary);
  outline-offset: -2px;
}

/* ==========================================================================
   9. FOCUS & ACCESSIBILITY
   ========================================================================== */
.profile-stat-item:focus-visible {
  outline: 2px solid var(--profile-primary);
  outline-offset: 2px;
}

.profile-cover-buttons > div:focus-visible,
.profile-avatar-change:focus-visible,
.profile-avatar-crop:focus-visible,
.profile-avatar-delete:focus-visible {
  outline: 2px solid var(--profile-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   10. MAIN CONTENT COLUMN & SCROLL
   ========================================================================== */
.profile-content-row {
  scroll-margin-top: 6rem;
}

.profile-right-panel {
  animation: profileContentEnter 0.5s ease-out 0.2s both;
}

@media (prefers-reduced-motion: reduce) {
  .profile-right-panel {
    animation: none;
  }
}
