/* settings.css – Einstellungsmodal (Sprache & Währung) mit Speichern-Button
   Design-inspiriert von profile.css, eigenständige Klassen.
   Barrierefreiheit: sichtbarer Fokus, Screenreader-only, reduzierte Bewegungen
*/

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,10,12,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 880;
}
.settings-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 40vw;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  transform: translate(-50%, -46%) scale(.96);
  background: linear-gradient(145deg,#191a1e 0%, #16171a 100%);
  border: 1.5px solid #222326;
  border-radius: 28px;
  box-shadow: 0 18px 48px -8px #000d, 0 0 22px #1d283355;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: transform .28s cubic-bezier(.7,.2,.2,1), opacity .28s;
  pointer-events: none;
  z-index: 900;
  color: #fff;
  overflow: hidden;
}
.settings-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 10px 26px;
  border-bottom: 1px solid #222326;
}
.settings-title {
  font-size: 1.28rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: .04em;
  background: linear-gradient(90deg,#fff,#dcdcdc);
  -webkit-background-clip: text;
  color: transparent;
}
.settings-x {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.7rem;
  line-height: 1;
  padding: 0;
  margin: 0;
  width: auto;
  height: auto;
  cursor: pointer;
}
.settings-x:hover { opacity: .9; }
.settings-x:active { transform: scale(.98); }
.settings-x:focus-visible {
  outline: 2px solid #7aa8ff;
  outline-offset: 3px;
  border-radius: 6px;
}

.settings-content {
  padding: 16px 26px 22px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 auto;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center; /* Sektionstitel/Optionen optisch zentriert */
  text-align: center;
}
.settings-section-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: #eaeaea;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center; /* Buttons zentrieren */
}
.settings-option {
  background: #2a2b2f;
  color: #e8e8e8;
  border: 1px solid #303236;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, box-shadow .16s, color .16s, border-color .16s, transform .06s;
  box-shadow: 0 2px 12px -4px rgba(0,0,0,0.55);
}
.settings-option:hover,
.settings-option:focus {
  background: #3a3c40; /* hellgrauer Hover statt Blau */
  border-color: #4a4d52;
}
.settings-option:focus { outline: none; }
.settings-option:focus-visible {
  outline: 2px solid #7aa8ff;
  outline-offset: 3px;
}
.settings-option:active { transform: translateY(1px); }
/* Aktive Auswahl dezent, kein Blau */
.settings-option.active {
  background: #34363a;
  border-color: #55595f;
  color: #fff;
  box-shadow: inset 0 0 0 1px #4d5056;
}

/* Footer mit Speichern-Button */
.settings-footer {
  border-top: 1px solid #222326;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: center; /* Speichern-Button zentriert */
  gap: 10px;
  background: #18191d;
}
.settings-save-btn {
  background: #2a2b2f; /* nicht Blau */
  color: #fff;
  border: 1px solid #303236;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .02em;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.04);
  transition: background .16s, box-shadow .16s, transform .06s, filter .16s, border-color .16s;
}
.settings-save-btn:hover,
.settings-save-btn:focus {
  background: #3a3c40; /* hellgrauer Hover */
  border-color: #4a4d52;
  box-shadow: 0 8px 22px -8px rgba(0,0,0,0.7);
}
.settings-save-btn:focus { outline: none; }
.settings-save-btn:focus-visible {
  outline: 2px solid #7aa8ff;
  outline-offset: 3px;
}
.settings-save-btn:active { transform: translateY(1px); }
.settings-save-btn.saved { filter: drop-shadow(0 0 6px #4ecb71); }

/* Screenreader-only Utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Reduced motion für Nutzerpräferenzen */
@media (prefers-reduced-motion: reduce) {
  .settings-backdrop,
  .settings-modal,
  .settings-option,
  .settings-save-btn {
    transition: none !important;
  }
  .settings-modal {
    transform: translate(-50%, -50%) !important;
  }
}

/* Responsive + Mobile Darker Theme */
@media (max-width: 700px) {
  .settings-backdrop.active {
    background: rgba(8, 8, 8, 0.86); /* neutral dunkles Grau für bessere Lesbarkeit */
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
  }
  .settings-modal {
    width: calc(100vw - 16px);
    border-radius: 24px;
    background: #0a0a0a; /* fast nur dunkelgrau, ohne Farbstich */
    border-color: #1f1f1f; /* leicht helleres Grau für klare Kante */
    box-shadow: 0 24px 60px -12px rgba(0,0,0,0.85), 0 0 22px rgba(0,0,0,0.35);
    color: #f2f3f4; /* Text insgesamt etwas heller für bessere Lesbarkeit */
  }
  .settings-header {
    border-bottom-color: #242424; /* etwas heller für Kontur */
    background: transparent;
  }
  .settings-title {
    font-size: 1.18rem;
    background: linear-gradient(90deg,#f6f6f7,#e1e1e2); /* hoher Kontrast in Grau */
    -webkit-background-clip: text;
    color: transparent;
  }
  .settings-content {
    padding: 14px 18px 18px 18px;
  }

  .settings-section-title {
    color: #ededee; /* helles Grau, gut lesbar */
  }

  .settings-option {
    background: #2a2c31;            /* Buttons leicht heller als Modal */
    border-color: #353940;          /* dezente Kante */
    color: #f1f2f3;                 /* hoher Kontrast */
    box-shadow: 0 2px 10px -6px rgba(0,0,0,0.7);
  }
  .settings-option:hover,
  .settings-option:focus {
    background: #31343a;            /* Hover minimal heller */
    border-color: #3d414a;
  }
  .settings-option:focus-visible {
    outline: 2px solid #7aa8ff;
    outline-offset: 3px;
  }
  .settings-option.active {
    background: #343841;            /* aktiver Zustand etwas heller */
    border-color: #484e58;
    box-shadow: inset 0 0 0 1px #4a505b;
    color: #ffffff;
  }

  .settings-footer {
    border-top-color: #1f1f1f;
    background: #0a0a0a;            /* gleich wie Modal für ruhiges Grau-Theme */
    padding: 10px 14px;
  }
  .settings-save-btn {
    background: #2a2c31;            /* leicht heller als Hintergrund */
    border-color: #3a3f47;
    color: #f6f7f8;
    padding: 10px 16px;
    box-shadow: 0 8px 22px -12px rgba(0,0,0,0.7);
  }
  .settings-save-btn:hover,
  .settings-save-btn:focus {
    background: #32353c;            /* Hover leicht heller */
    border-color: #474c55;
    box-shadow: 0 10px 26px -12px rgba(0,0,0,0.85);
  }
  .settings-save-btn:focus-visible {
    outline: 2px solid #7aa8ff;
    outline-offset: 3px;
  }
}