

/* =========================
   Profile Settings Styles
   ========================= */
:root {
  --profile-card-bg: #fff;
  --profile-border: var(--border-color, #e2e2e3);
  --profile-muted: var(--text-color, #767676);
  --profile-pad: 16px;
  --profile-radius: 14px;
}

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  height: 100%;
  box-sizing: border-box;
}

/* Card */
.profile-card {
  background: var(--profile-card-bg);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  padding: var(--profile-pad);
}

.section-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.muted { color: var(--profile-muted); }
.hidden { display: none !important; }

/* Header / images */
.header-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.cover-wrap {
  position: relative;
  width: 450px;
  min-height: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--profile-border);
  background: linear-gradient(180deg, #f3f6fb, #e9f1ff);
}

.cover-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.img-change {
  position: absolute;
  right: 12px;
  bottom: 12px;
  backdrop-filter: blur(6px);
}

.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.name-row {
  margin-top: 8px;
}

.business-name {
  margin: 0;
}

/* Field rows */
.field-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--profile-border);
}

.field-row:first-of-type { border-top: 0; }

.editable-label {
  font-size: 0.9rem;
  color: var(--profile-muted);
  padding-top: 8px;
}

.view-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.value-text { white-space: pre-wrap; }

.edit-btn { --sl-spacing-small: 0; }

.edit-row {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.edit-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Inputs full width inside edit mode */
#blurbInput,
#firstnameInput,
#lastnameInput,
#emailInput,
#phoneInput,
#address1Input,
#address2Input,
#cityInput,
#stateInput,
#zipInput {
  width: 100%;
}

/* Responsive */
@media (max-width: 820px) {
  .header-row { grid-template-columns: 1fr; }
  .avatar-wrap { align-items: flex-start; }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }
  .editable-label { padding-top: 0; }
  .view-row { justify-content: space-between; }
  .edit-row { grid-column: 1 / -1; }
}

/* Hover/focus affordances */
.edit-btn:hover { color: var(--affiliBlue, #00488b); }
.img-change:hover { filter: brightness(1.05); }

/* Utilities specific to this page */
.profile-page sl-textarea::part(base),
.profile-page sl-input::part(base) {
  /* Make inputs feel airy inside cards */
  --sl-input-border-color: var(--profile-border);
}

.avatar-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 125px;
    width: 135px;
}

/* Placeholders */
.cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-top: 1px solid var(--profile-border);
  border-bottom: 1px solid var(--profile-border);
  color: var(--sl-color-neutral-500, #6b7280);
}
.cover-placeholder sl-icon { font-size: 40px; color: var(--sl-color-neutral-400, #9ca3af); }

.avatar-placeholder {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px dashed var(--profile-border);
  color: var(--sl-color-neutral-500, #6b7280);
}
.avatar-placeholder sl-icon { font-size: 28px; color: var(--sl-color-neutral-400, #9ca3af); }

.changeicon {
  position: absolute;
  bottom: 0; /* Adjust to desired spot over avatar */
  right: 0;
  transform: translate(25%, 25%);
  backdrop-filter: blur(6px);
}

/* Make the description row use full width (no label column) */
.field-row[data-field="description"] .view-row {
  grid-column: 1 / 4;   /* span all columns */
}

/* In edit mode, span full width too */
.field-row[data-field="description"] #edit-description {
  grid-column: 1 / 4;
}

/* Dark mode */
:root.sl-theme-dark {
  --profile-card-bg: var(--mm-dark-surface, #0f172a);
  --profile-border: var(--mm-dark-border, rgba(148, 163, 184, 0.2));
  --profile-muted: var(--mm-dark-muted, #94a3b8);
}

:root.sl-theme-dark .profile-page {
  color: var(--mm-dark-body, #cbd5e1);
}

:root.sl-theme-dark .profile-card {
  box-shadow: var(--mm-dark-shadow, 0 20px 40px rgba(2, 6, 23, 0.6));
}

:root.sl-theme-dark .cover-wrap {
  background: linear-gradient(180deg, var(--mm-dark-surface-2, #111827), var(--mm-dark-surface, #0f172a));
}

:root.sl-theme-dark .cover-placeholder {
  background: var(--mm-dark-surface-2, #111827);
  color: var(--mm-dark-muted, #94a3b8);
}

:root.sl-theme-dark .cover-placeholder sl-icon {
  color: var(--mm-dark-muted, #94a3b8);
}

:root.sl-theme-dark .avatar-placeholder {
  background: var(--mm-dark-surface-2, #111827);
  border-color: var(--profile-border);
  color: var(--mm-dark-muted, #94a3b8);
}

:root.sl-theme-dark .avatar-placeholder sl-icon {
  color: var(--mm-dark-muted, #94a3b8);
}
