/**
 * Profile page styles. Brand-aligned: red #fe424d accents, Plus Jakarta Sans,
 * 1rem rounded card. Dark-mode friendly via [data-theme="dark"] overrides.
 */

.profile-wrap {
  max-width: 720px;
  margin: 2rem auto 4rem;
  padding-inline: 1rem;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.profile-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.profile-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #1a1a1a;
}

.profile-card__sub {
  color: #6b6b6b;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: #f3f3f3;
  flex-shrink: 0;
  border: 2px solid #fe424d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fe424d;
  background: #fff5f6;
}

.profile-avatar-actions {
  flex: 1;
  min-width: 0;
}

.profile-avatar-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #1a1a1a;
}

.profile-avatar-actions input[type="file"] {
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.profile-hint {
  display: block;
  margin-top: 0.4rem;
  color: #8a8a8a;
  font-size: 0.8rem;
}

.profile-form .form-control {
  border-radius: 0.6rem;
}

.profile-form .form-control:focus {
  border-color: #fe424d;
  box-shadow: 0 0 0 0.2rem rgba(254, 66, 77, 0.15);
}

.profile-bio {
  min-height: 110px;
  resize: vertical;
}

.profile-bio-counter {
  font-size: 0.8rem;
  color: #8a8a8a;
  text-align: right;
  margin-top: 0.25rem;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Dark mode */
[data-theme="dark"] .profile-card {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .profile-card__title {
  color: #f5f5f7;
}

[data-theme="dark"] .profile-card__sub,
[data-theme="dark"] .profile-hint,
[data-theme="dark"] .profile-bio-counter {
  color: #a8a8ad;
}

[data-theme="dark"] .profile-avatar-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .profile-avatar-preview {
  background: #2a2a2c;
}

[data-theme="dark"] .profile-avatar-fallback {
  background: #2a2a2c;
  color: #fe346a;
}

[data-theme="dark"] .profile-avatar-label {
  color: #f5f5f7;
}

[data-theme="dark"] .profile-form .form-control {
  background: #2a2a2c;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

[data-theme="dark"] .profile-form .form-control:focus {
  border-color: #fe424d;
  box-shadow: 0 0 0 0.2rem rgba(254, 66, 77, 0.25);
}

/* Navbar avatar (rendered inside #user-initial when avatar.url is set) */
#user-initial .user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

@media (max-width: 540px) {
  .profile-card {
    padding: 1.5rem 1.25rem;
  }
  .profile-avatar-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
