/**
 * user-settings.css
 * -----------------
 * Styles for the Settings panel UI (gear icon + slide-over).
 * Scoped to .discovery-zone context to prevent bleed into main site styles.
 * 
 * Brand colors:
 *   Ocean Blue  #0D3B6E
 *   Forest Green #2D6A4F
 *   Sand Gold   #C8963E
 *   Gold-dk     #A97B2C
 */

/* ---- Settings gear button -------------------------------------------- */
.discovery-zone .settings-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: #0D3B6E;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 150ms ease, color 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discovery-zone .settings-btn:hover {
  background: rgba(13, 59, 110, 0.08);
}

.discovery-zone .settings-btn:focus {
  outline: 2px solid #C8963E;
  outline-offset: 2px;
}

.discovery-zone .settings-btn svg {
  width: 20px;
  height: 20px;
}

/* ---- Settings overlay (backdrop) ------------------------------------- */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.settings-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ---- Settings panel (slide-over) ------------------------------------- */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90vw;
  max-width: 400px;
  background: #fff;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 250ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-panel.is-visible {
  transform: translateX(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .settings-overlay, .settings-panel {
    transition: none;
  }
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #d9e1ec;
  background: #f6f8fb;
}

.settings-header h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 18px;
  color: #0D3B6E;
}

.settings-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #666;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 150ms ease, color 150ms ease;
}

.settings-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

.settings-close:focus {
  outline: 2px solid #C8963E;
  outline-offset: 2px;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ---- Settings groups ------------------------------------------------- */
.settings-group {
  margin-bottom: 24px;
}

.settings-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #0D3B6E;
}

.settings-hint {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* ---- Segmented control ----------------------------------------------- */
.settings-segmented {
  display: flex;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 6px;
  padding: 4px;
}

.settings-segmented button {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.settings-segmented button:hover {
  background: rgba(13, 59, 110, 0.08);
}

.settings-segmented button.active {
  background: #0D3B6E;
  color: #fff;
}

.settings-segmented button:focus {
  outline: 2px solid #C8963E;
  outline-offset: -2px;
}

/* ---- Checkbox -------------------------------------------------------- */
.settings-checkbox {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0D3B6E;
}

.settings-label:has(.settings-checkbox) {
  display: flex;
  align-items: center;
  font-weight: 400;
  color: #333;
}

/* ---- Reset button ---------------------------------------------------- */
.settings-reset-btn {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #C8963E;
  background: #fff;
  color: #C8963E;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.settings-reset-btn:hover {
  background: #C8963E;
  color: #fff;
}

.settings-reset-btn:focus {
  outline: 2px solid #C8963E;
  outline-offset: 2px;
}

/* ---- Mobile responsive ----------------------------------------------- */
@media (max-width: 480px) {
  .settings-panel {
    width: 100vw;
    max-width: none;
  }
}
