/* ════════════════════════════════════════════════════════════
   OXCART — Settings Page Styles
   Editorial Minimal Premium Warm Calm Content-First
   Palette: #f1ece6, #ddd5cd, #2e2e2e
   ════════════════════════════════════════════════════════════ */

/* ── Page Layout ─────────────────────────────────────────── */
.settings-page {
  background-color: var(--color-background);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.settings-main {
  flex: 1;
  padding: 130px 0 120px;
}

.settings-container {
  width: 90%;
  max-width: 760px;
  margin: 0 auto;
}

/* ── Header Elements ─────────────────────────────────────── */
.notification-dot {
  font-size: 0.55rem;
  color: var(--color-text);
  line-height: 1;
  display: inline-block;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.notification-dot:hover {
  opacity: 1;
  transform: scale(1.2);
}

.notification-dot.hidden {
  display: none;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-text);
  color: var(--color-background);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-editorial);
}

.avatar-circle:hover {
  transform: scale(1.05);
}

/* ── Page Title / Hero ───────────────────────────────────── */
.settings-hero {
  margin-bottom: 56px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 32px;
}

.settings-eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.settings-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: 8px;
}

.settings-subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ── Section Structure ───────────────────────────────────── */
.settings-section {
  margin-bottom: 64px;
}

.section-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 64px 0;
  width: 100%;
}

.settings-section-header {
  margin-bottom: 36px;
}

.settings-section-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 10px;
}

.settings-section-desc {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 580px;
}

/* ── Form & Profile Fields ───────────────────────────────── */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
}

.field-optional {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.field-input-wrap {
  position: relative;
  width: 100%;
}

.field-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border-strong);
  border-radius: 0;
  padding: 10px 0 8px;
  transition: border-color 0.25s ease;
  -webkit-appearance: none;
}

.field-input:focus {
  outline: none;
  border-bottom-color: var(--color-text);
}

.field-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.form-group.has-error .field-input {
  border-bottom-color: #b33939;
}

.field-hint,
.field-desc {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.field-error {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: #b33939;
  margin-top: 4px;
  display: none;
}

.form-group.has-error .field-error {
  display: block;
}

/* ── Actions & Buttons ───────────────────────────────────── */
.form-actions-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 12px;
}

.editorial-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text);
  background: transparent;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease;
}

.editorial-btn .btn-arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-editorial);
}

.editorial-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.editorial-btn::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s var(--ease-editorial);
}

.editorial-btn:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.save-status {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.save-status.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Language Section ────────────────────────────────────── */
.language-selector-wrap {
  position: relative;
  max-width: 320px;
}

.language-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border-strong);
  border-radius: 0;
  padding: 10px 0 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s ease;
}

.language-trigger:focus-visible {
  outline: none;
  border-bottom-color: var(--color-text);
}

.language-arrow {
  font-size: 0.75rem;
  transition: transform 0.25s var(--ease-editorial);
}

.language-selector-wrap.open .language-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background-color: var(--color-secondary);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.language-selector-wrap.open .language-dropdown {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.language-option {
  width: 100%;
  padding: 10px 18px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.language-option:hover,
.language-option:focus-visible {
  background-color: var(--color-text);
  color: var(--color-background);
  outline: none;
}

.language-option.active {
  font-weight: 700;
}

.language-option.active::after {
  content: '✓';
  font-size: 0.85rem;
}

/* ── Appearance Section ──────────────────────────────────── */
.appearance-options {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 12px;
}

.theme-option-btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease;
}

.theme-option-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--color-text);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease-editorial);
}

.theme-option-btn:hover {
  color: var(--color-text);
}

.theme-option-btn.active {
  color: var(--color-text);
}

.theme-option-btn.active::after {
  transform: scaleX(1);
}

/* ── Account Section ─────────────────────────────────────── */
.account-actions-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.account-action-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.account-action-desc {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  max-width: 520px;
}

/* ── Delete Confirmation Modal ───────────────────────────── */
.delete-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.delete-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.delete-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.delete-modal-box {
  position: relative;
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 480px;
  padding: 40px;
  z-index: 1;
  transform: translateY(12px);
  transition: transform 0.25s var(--ease-editorial);
}

.delete-modal-overlay.open .delete-modal-box {
  transform: translateY(0);
}

.delete-modal-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 14px;
}

.delete-modal-text {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.delete-modal-text strong {
  color: var(--color-text);
  font-weight: 700;
}

.delete-input-wrap {
  margin-bottom: 28px;
}

.delete-input {
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
}

.modal-cancel-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-cancel-btn:hover {
  color: var(--color-text);
}

.modal-delete-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border-strong);
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.modal-delete-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.modal-delete-btn:not(:disabled):hover {
  background-color: var(--color-text);
  color: var(--color-background);
  border-color: var(--color-text);
}

/* ── Responsive Adaptations ──────────────────────────────── */
@media (max-width: 768px) {
  .settings-main {
    padding: 110px 0 80px;
  }

  .settings-hero {
    margin-bottom: 40px;
    padding-bottom: 24px;
  }

  .settings-section {
    margin-bottom: 48px;
  }

  .section-divider {
    margin: 48px 0;
  }

  .appearance-options {
    gap: 20px;
  }

  .delete-modal-box {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .appearance-options {
    flex-wrap: wrap;
    gap: 16px;
  }

  .delete-modal-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .modal-delete-btn,
  .modal-cancel-btn {
    text-align: center;
    width: 100%;
  }
}

/* Global language dropdown: keep the menu in its own visual layer and reserve space below it. */
.language-selector-wrap {
  position: relative;
  z-index: 20;
  width: min(100%, 420px);
  max-width: 420px;
}

.language-dropdown {
  top: calc(100% + 8px);
  width: 100%;
  z-index: 1100;
  background: #f1ece6;
  color: #2e2e2e;
  border: 1px solid rgba(46, 46, 46, 0.18);
  box-shadow: 0 14px 30px rgba(46, 46, 46, 0.12);
}

.language-option {
  color: #2e2e2e;
}

.language-option:hover,
.language-option:focus-visible {
  background: #2e2e2e;
  color: #f1ece6;
}

[data-theme="dark"] .language-dropdown {
  background: #363636;
  color: #f1ece6;
  border-color: rgba(241, 236, 230, 0.18);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .language-option {
  color: #f1ece6;
}

[data-theme="dark"] .language-option:hover,
[data-theme="dark"] .language-option:focus-visible {
  background: #f1ece6;
  color: #363636;
}

#language-section.dropdown-open {
  padding-bottom: 180px;
}

@media (max-width: 480px) {
  .language-selector-wrap {
    width: 100%;
    max-width: none;
  }

  #language-section.dropdown-open {
    padding-bottom: 190px;
  }
}

.settings-page [data-settings-auth-only][hidden],
.settings-page [data-auth-only][hidden] {
  display: none !important;
}
