/* settings.css -- settings modal, metric toggles */

/* ── Settings Modal ──────────────────────────────────────────────────── */
#settings-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r); display: none; flex-direction: column; width: 480px; max-width: 95vw; max-height: 85vh; overflow: hidden; z-index: 61; box-shadow: var(--shadow-lg); }

/* Profile modal (centered, mirrors #settings-modal) */
#profile-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r); display: none; flex-direction: column; width: 400px; max-width: 95vw; max-height: 85vh; overflow: hidden; z-index: 61; box-shadow: var(--shadow-lg); }

/* Generic confirm modal (centered, mirrors #settings-modal). Sits in its own
   z-index tier (70/71) above every feature modal so it can ALSO be triggered
   from inside an open modal (e.g. Profile → Delete my account). */
#confirm-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r); display: none; flex-direction: column; width: 440px; max-width: 95vw; overflow: hidden; z-index: 71; box-shadow: var(--shadow-lg); }
#confirm-ok.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
#confirm-ok.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* ── Toggle switches (pseudo-elements) ────────────────────────────────── */
.metric-toggle { width: 2.5rem; height: 1.375rem; border-radius: 9999px; background: var(--bg-elevated); border: 1px solid var(--border); position: relative; cursor: pointer; transition: background 0.15s, border-color 0.15s; flex-shrink: 0; }
.metric-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 50%; background: var(--text-faint); transition: transform 0.15s, background 0.15s; }
.metric-toggle.on { background: var(--btn-primary-bg); border-color: var(--btn-primary-border); }
.metric-toggle.on::after { transform: translateX(1.125rem); background: var(--green); }
.metric-section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 0.75rem; margin-top: 0; }
.metric-section-title:not(:first-of-type) { margin-top: 1.5rem; }
.metric-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--border-sub); }
.metric-toggle-row span { color: var(--text-secondary); font-size: 0.9375rem; }

/* ── Profile email row (read-only identity from supabase auth) ────────── */
.profile-email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-sub);
}
.profile-email-label {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}
.profile-email-value {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-mono, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

/* ── Profile sign-out (destructive action per STYLE-GUIDE §7) ─────────── */
.profile-signout-row {
  border-top: 1px solid var(--border-sub);
  padding-top: 1rem;
  margin-top: 0.25rem;
}
.profile-signout-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--rm);
  color: var(--red);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.profile-signout-btn:hover {
  background: var(--red-bg);
  border-color: var(--red);
}
.profile-signout-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.profile-signout-btn i,
.profile-signout-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Profile delete-account (mirrors signout shape; hover fills red) ───── */
.profile-delete-row {
  border-top: 1px solid var(--border-sub);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.profile-delete-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--rm);
  color: var(--red);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.profile-delete-btn:hover {
  background: var(--red);
  color: var(--text-on-red, #fff);
  border-color: var(--red);
}
.profile-delete-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.profile-delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.profile-delete-btn i,
.profile-delete-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
