/* Account Settings Page - Matching Figma Design */

/* Two-column layout: form | portrait */
/* Mobile: stacked layout - form, portrait, signout */
.user-settings-container {
  display: grid;
  grid-template-rows: auto;
  grid-template-columns: 1fr;
  grid-template-areas:
    "form"
    "portrait"
    "signout";
  gap: 32px;
  align-items: start;
  padding: 0;
  max-width: 800px;
}

/* Tablet and Desktop breakpoint: 2 columns (form + portrait) */
@media only screen and (min-width: 768px) {
  .user-settings-container {
    grid-template-columns: 1fr 240px;
    grid-template-areas:
      "form portrait";
    column-gap: 100px;
    row-gap: 0;
    padding: 0;
    align-items: stretch;
  }
}

/* ===== CENTER FORM COLUMN ===== */
.user-settings-form-column {
  grid-area: form;
}

.user-settings-form {
  max-width: 400px;
  width: 100%;
  gap: 0;
}

/* Section Title - "ACCOUNT SETTINGS" */
.user-settings-section-title {
  color: var(--Default-Palette-mb, #1C1D17);
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 540;
  line-height: 24px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin: 0 0 24px 0;
}

/* Form submit button - align right */
.form input[type="submit"] {
  display: block;
}

/* Form field wrappers */
.user-settings-form .field-wrapper {}

.user-settings-form .field-wrapper:last-of-type {
  margin-bottom: 0;
}

/* Input fields styling - underline only */
.user-settings-form .input-text {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--grey-300, #ccc);
  border-radius: 0;
  background: transparent;
  padding: 8px 0;
  color: var(--DC-Greys-900, #3B3933);
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
}

.user-settings-form .input-text:focus {
  outline: none;
  border-bottom-color: var(--mb, #1C1D17);
}

/* Form labels */
.user-settings-form label {
  color: var(--DC-Greys-900, #3B3933);
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 540;
  line-height: 20px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0;
}

/* Email verified status badge - green text style like Figma */
.field-topmatter-status.verified {
  background: transparent;
  color: #7A9A7E;
  font-family: Montserrat, sans-serif;
  font-size: 12px;
  font-weight: 540;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0;
}

/* SAVE CHANGES button - var(--mb-70) color, disabled when no changes */
.user-settings-update-btn {
  display: inline-block;
  margin-top: 20px;
  margin-bottom: 32px;
  background-color: var(--mb);
  border-color: var(--mb);
  color: var(--shw);
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.user-settings-update-btn:hover:not(.disabled):not(:disabled) {
  background-color: var(--mb);
  border-color: var(--mb);
}

.user-settings-update-btn.disabled,
.user-settings-update-btn:disabled {
  background-color: var(--mb-70);
  border-color: var(--mb-70);
  color: var(--shw);
  opacity: 1;
  cursor: not-allowed;
}

.user-settings-update-btn.disabled:hover,
.user-settings-update-btn:disabled:hover {
  background-color: var(--mb-70);
  border-color: var(--mb-70);
}

/* "YOUR PREFERENCES" section title */
.user-settings-preferences-title {
  color: var(--mb, #1C1D17);
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 540;
  line-height: 20px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin: 0 0 16px 0;
}

/* Preferences checkboxes: label left, checkbox right */
.user-settings-form .field-wrapper.horizontal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 280px;
  padding: 8px 0;
  margin-bottom: 0;
}

.user-settings-form .field-wrapper.horizontal label {
  order: 1;
  flex: 1;
  margin-bottom: 0;
  color: #000;
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
  text-transform: none;
}

.user-settings-form .field-wrapper.horizontal .checkbox-box {
  order: 2;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: -120px;
}

/* Preferences auto-save section (outside form) */
.user-settings-preferences-section {
  max-width: 400px;
}

.user-settings-preferences-section .field-wrapper.horizontal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 280px;
  padding: 8px 0;
  margin-bottom: 0;
}

.user-settings-preferences-section .field-wrapper.horizontal label {
  order: 1;
  flex: 1;
  margin-bottom: 0;
  color: #000;
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
  text-transform: none;
}

.user-settings-preferences-section .field-wrapper.horizontal .checkbox-box {
  order: 2;
  flex-shrink: 0;
  margin-left: auto;
}

/* Preference auto-save status indicator */
.preference-status {
  order: 3;
  font-family: Montserrat;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-left: 8px;
  min-width: 50px;
  transition: opacity 0.2s ease;
}

.preference-status:empty {
  display: none;
}

.preference-status.saving {
  color: var(--mb-70);
}

.preference-status.success {
  color: var(--status-green);
}

.preference-status.error {
  color: var(--status-red);
}

/* ===== RIGHT PORTRAIT COLUMN ===== */
.user-settings-portrait-column {
  grid-area: portrait;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  height: 100%;
}

.user-portrait-field-wrapper {
  --size: 198px;
  width: var(--size);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.user-portrait-field-wrapper label {
  color: var(--Default-Palette-mb, #1C1D17);
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 540;
  line-height: 20px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 65px;
  align-self: flex-start;
}

.user-settings-portrait-preview {
  width: 198px;
  height: 198px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 16px;
  margin-bottom: 20px;

  &.placeholder {
    background-color: var(--grey-100);
    border: 1px solid var(--grey-200);
  }
}

.user-settings-portrait-edit {
  position: static;
  margin-top: 0;
  align-self: flex-end;
  margin-left: auto;
}

/* ===== SIGN OUT BUTTON ===== */
.user-settings-signout-btn {
  width: fit-content;
  margin-top: 0;
  align-self: flex-end;
}

/* Style the sign out button inside button_to form */
.user-settings-container .user-settings-portrait-column form {
  width: fit-content;
  align-self: flex-end;
}

/* ===== ARTIST PROFILE BUTTON IN TOP BAR ===== */
.dashboard-top-bar {
  position: relative;
}

.dashboard-top-bar .button.outline {
  position: absolute;
  left: 805px;
  top: 50%;
  transform: translateY(-50%);
}

/* ===== ADDITIONAL PORTRAIT FORM STYLES ===== */
.users-profile-image-form-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  &[hidden] {
    display: none;
  }
}

.portrait-form-container {
  display: flex;
  flex-direction: column;
  gap: var(--crotchet);
  margin-top: 58px;
}

.portrait-action-buttons {
  display: flex;
  gap: var(--crotchet);
  align-items: center;
}

.portrait-action-buttons .inline-form {
  display: inline;
  margin: 0;
}

.no-underline {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--quaver);
  font-weight: 540;
  color: var(--mb-70) !important;
}

.back-icon {
  width: 8px;
  height: 8px;
  color: var(--fg-lighter);
  transform: rotate(180deg);
}

/* ===== PORTRAIT EDIT PAGE STYLES ===== */
/* Portrait Edit Page - Match Account Settings positioning */
body.portraits.edit .sidebar {
  margin-top: 20px;
  margin-left: 90px;
}

body.portraits.edit .dashboard-top-bar-info-container {
  margin-left: 120px;
}

.portrait-edit-page {
  display: flex;
  flex-direction: column;
  gap: var(--crotchet);
}

.portrait-edit-header {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 120px;
  margin-top: 5px;
}

.portrait-edit-title {
  color: var(--Default-Palette-mb, #1C1D17);
  text-align: center;
  font-family: Montserrat;
  font-size: 14px;
  font-style: normal;
  font-weight: 540;
  line-height: 20px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin: 0;
}

.portrait-edit-back-link {
  color: var(--Default-Palette-mb-70, #B2B3AD);
  font-family: Montserrat;
  font-size: 12px;
  font-style: normal;
  font-weight: 540;
  line-height: 18px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  margin-left: 80px;
}

.portrait-edit-back-link:hover {
  text-decoration: underline;
}

/* Adjust portrait wrapper for edit page */
.portrait-edit-page .user-portrait-field-wrapper {
  margin-top: 20px;
  margin-right: 0;
  margin-left: 0;
  align-items: flex-start;
}

.portrait-edit-page .portrait-form-container {
  margin-top: 0;
}

.portrait-edit-page .portrait-action-buttons,
.portrait-edit-page .form-actions {
  margin-left: 0;
  margin-top: 20px;
}

/* ===== CUSTOM SELECT DROPDOWN FOR USER SETTINGS ===== */
.user-settings-form .custom-select-wrapper {
  position: relative;
  width: 100%;
}

.user-settings-form .custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--grey-300, #ccc);
  cursor: pointer;
  text-align: left;
}

.user-settings-form .custom-select-trigger:focus {
  outline: none;
  border-bottom-color: var(--mb, #1C1D17);
}

.user-settings-form .custom-select-display {
  font-family: Montserrat;
  font-size: 14px;
  font-weight: 400;
  color: var(--DC-Greys-900, #3B3933);
  line-height: 18px;
  letter-spacing: 0.28px;
}

.user-settings-form .custom-select-chevron {
  font-size: 18px;
  color: var(--mb-70, #B2B3AD);
  transition: transform 0.2s ease;
}

.user-settings-form .custom-select-trigger[aria-expanded="true"] .custom-select-chevron {
  transform: rotate(90deg);
}

.user-settings-form .custom-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 0;
  overflow: hidden;
  background-color: var(--shw, #B2B3AD);
  border: 1px solid var(--mb-70, #B2B3AD);
  border-radius: 0 0 4px 4px;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-settings-form .custom-select-menu.open {
  max-height: 200px;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
}

.user-settings-form .custom-select-menu::-webkit-scrollbar {
  width: 6px;
}

.user-settings-form .custom-select-menu::-webkit-scrollbar-track {
  background: transparent;
}

.user-settings-form .custom-select-menu::-webkit-scrollbar-thumb {
  background: var(--grey-400);
  border-radius: 3px;
}

.user-settings-form .custom-select-menu::-webkit-scrollbar-thumb:hover {
  background: var(--grey-600);
}

.user-settings-form .custom-select-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-family: Montserrat;
  font-size: 14px;
  font-weight: 400;
  color: var(--DC-Greys-900, #3B3933);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.user-settings-form .custom-select-option:hover,
.user-settings-form .custom-select-option:focus {
  background-color: var(--grey-100, #f5f5f5);
  outline: none;
}

.user-settings-form .custom-select-option.selected {
  color: var(--mb, #1C1D17);
  font-weight: 500;
}

.user-settings-form .custom-select-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}