/* Copyright (c) 2025-2026 Ioannis Belesiotis. All rights reserved.
   This source code is proprietary and confidential. */
/* ── My Preferences Modal ───────────────────────────────────────────────── */

.my-prefs-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.my-prefs-modal.hidden {
  display: none;
}

.my-prefs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 34, 60, 0.50);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.my-prefs-dialog {
  position: relative;
  z-index: 1;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
}

.my-prefs-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.my-prefs-header h3 {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text);
}

.my-prefs-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

.my-prefs-intro {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.my-prefs-section {
  padding: 0;
}

.my-prefs-section + .my-prefs-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.my-prefs-section-title {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ── Theme picker — reuses theme-card from catalyst.css ───────────────── */

.my-prefs-theme-picker {
  display: flex;
  gap: 12px;
}

.my-prefs-theme-picker .theme-card {
  flex: 1;
}

/* "Org default" theme card — split preview */
.mp-theme-auto {
  background: linear-gradient(135deg, #f4f5f9 50%, #1e2235 50%);
}
.mp-theme-auto .tp-header {
  background: linear-gradient(90deg, #e0e0e8 50%, #2a2f4a 50%);
  height: 10px;
  border-radius: 2px 2px 0 0;
}
.mp-theme-auto .tp-body {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mp-theme-auto .tp-line {
  height: 4px;
  background: linear-gradient(90deg, #c8c8d4 50%, #3d4260 50%);
  border-radius: 2px;
}
.mp-theme-auto .tp-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--color-accent) 50%, #6366f1 50%);
  border-radius: 2px;
  margin: 2px 0;
}

/* ── Zoom toggle row ──────────────────────────────────────────────────── */

.my-prefs-zoom-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mp-reset-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--font-xs);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.mp-reset-link:hover {
  color: var(--color-accent);
}

/* ── Calendar range ───────────────────────────────────────────────────── */

.my-prefs-range-row {
  display: flex;
  gap: 20px;
}

.my-prefs-range-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

.my-prefs-input-narrow {
  width: 56px;
  font-size: var(--font-xs);
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: center;
}

.my-prefs-input-narrow:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

.my-prefs-input-narrow::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Tri-toggle (On / Off / Org) ──────────────────────────────────────── */

.my-prefs-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.my-prefs-toggle-row + .my-prefs-toggle-row {
  margin-top: 14px;
}

.my-prefs-toggle-label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text);
}

.mp-tri-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mp-tri-btn {
  padding: 4px 14px;
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mp-tri-btn + .mp-tri-btn {
  border-left: 1px solid var(--color-border);
}

.mp-tri-btn.active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 500;
}

.mp-tri-btn:hover:not(.active) {
  background: var(--color-accent-subtle);
}

/* ── Settings General tab hint for non-Admin ──────────────────────────── */

.my-prefs-hint {
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.my-prefs-hint-link {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.my-prefs-hint-link:hover {
  color: var(--color-text);
}
