/* =============================================================
   SETTINGS TAB — Polished UI
   Modern card-based sections with consistent spacing,
   icon headers, and refined form styling.
   Depends on: tokens.css
   ============================================================= */

/* ── Page container ────────────────────────────────────────── */

.settings-page {
  padding: 0 4px;
}

.settings-page > h2 {
  font-size: 1.3rem;
  margin-bottom: 14px;
}

/* ── Section cards ─────────────────────────────────────────── */

.profile-section {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 14px !important;
  padding: 18px 16px !important;
  margin-bottom: 12px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
}

.profile-section h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.02em;
}

/* ── Form labels ───────────────────────────────────────────── */

.profile-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  margin-top: 12px;
}

.profile-section label:first-of-type {
  margin-top: 0;
}

/* Checkbox labels */
.profile-section label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 0.85rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 8px 0;
}

/* ── Form inputs ───────────────────────────────────────────── */

.profile-section input[type="text"],
.profile-section input[type="number"],
.profile-section input[type="date"],
.profile-section input[type="time"],
.profile-section select,
.profile-section textarea {
  width: 100%;
  padding: 10px 14px;
  margin: 0 0 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  color: var(--text-color);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.profile-section input:focus,
.profile-section select:focus,
.profile-section textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45,125,91,0.15);
}

.profile-section textarea {
  min-height: 60px;
  resize: vertical;
}

/* ── Buttons ───────────────────────────────────────────────── */

.profile-section button[type="submit"],
.profile-section button[type="button"],
#saveSettingsButton,
#saveAppSettingsButton {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #38a870, var(--primary), #245f47);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  margin: 14px 0 0;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(45,125,91,0.25);
  transition: filter 0.2s;
}

.profile-section button[type="submit"]:hover,
.profile-section button[type="button"]:hover,
#saveSettingsButton:hover,
#saveAppSettingsButton:hover {
  filter: brightness(1.1);
  transform: none;
}

/* Secondary buttons (logout etc) */
.profile-section button.secondary,
#logoutBtn {
  background: transparent !important;
  border: 1px solid var(--border-color) !important;
  color: var(--secondary-text) !important;
  box-shadow: none !important;
}

#logoutBtn:hover {
  border-color: #c05060 !important;
  color: #c05060 !important;
}

/* ── Mode switcher buttons ─────────────────────────────────── */

.mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-btn {
  padding: 10px 8px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-color) !important;
  background: var(--surface-bg) !important;
  color: var(--secondary-text) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  width: auto !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.mode-btn.active {
  background: rgba(45,125,91,0.15) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* ── Gamification summary grid ─────────────────────────────── */

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.profile-summary-grid > div {
  background: var(--surface-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.profile-summary-grid span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.profile-summary-grid strong {
  display: block;
  font-size: 1.1rem;
  color: var(--primary);
  margin-top: 2px;
}

/* ── Export section styling ─────────────────────────────────── */

.export-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 12px;
}

.export-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 4px;
}

.export-section-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.export-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  color: var(--secondary-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
  margin: 0;
  box-shadow: none;
  font-family: inherit;
}

.export-btn:hover {
  border-color: var(--primary);
  color: var(--text-color);
  transform: none;
}

.export-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.export-btn-icon {
  font-size: 1rem;
}

/* ── Checkbox styling ──────────────────────────────────────── */

.profile-section input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  margin: 0;
  flex-shrink: 0;
}
