/*
  Stile für die Senioren‑KI‑Ratgeber‑Webseite
  Die Gestaltung berücksichtigt Forschungsergebnisse zur Barrierefreiheit für
  ältere Menschen: große Schrift, hohe Kontraste und einfache Navigation
  【722629636488158†L248-L357】【722629636488158†L311-L379】【778216771372795†L347-L417】.
*/

/* CSS‑Variablen erlauben das einfache Anpassen von Schriftgrößen und Farben. */
:root {
  --base-font-size: 18px;
  --font-family: "Arial", "Helvetica", sans-serif;
  --background-color: #ffffff;
  --text-color: #222222;
  /* Farben angelehnt an das Design von seniorentreff.de */
  --primary-color: #20539a; /* dunkles ST-Blau */
  --secondary-color: #3f79c7; /* helleres Blau für Buttons */
  --border-radius: 6px;
  --chat-bg: #f9f9f9;
}

/* Hoher Kontrast/Dunkelmodus */
body.dark-mode {
  --background-color: #0f1923;
  --text-color: #f0f4f8;
  --primary-color: #88b4e0;
  --secondary-color: #3a8dd8;
  --chat-bg: #1f2d3a;
}

/* Grundlegende Layoutregeln */
body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--base-font-size);
  background-color: var(--background-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 0.5rem 1rem;
  /* Flex-Layout für Logo, Titel und Einstellungen */
  display: block; /* Platzhalter: Inhalt wird in .header-content gestaltet */
}

/* Layout innerhalb des Headers */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
}

.logo img {
  width: 58px;
  height: auto;
  margin-right: 0.6rem;
}

.title-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
}

header .subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

header .controls {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

header button {
  background: var(--secondary-color);
  color: #ffffff;
  border: none;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  border-radius: var(--border-radius);
  cursor: pointer;
}

header button:hover,
header button:focus {
  background: #007acc;
  outline: none;
}

nav {
  background-color: var(--chat-bg);
  padding: 0.5rem;
}

/* Einstellungen für die Auswahl der Sprachsynthese */
#voiceSettings {
  background-color: var(--chat-bg);
  padding: 0.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

#voiceSettings label,
#voiceSettings select,
#voiceSettings input[type="range"] {
  font-size: 0.9rem;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

nav li {
  margin: 0;
}

nav button.advisor-btn {
  background: var(--secondary-color);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  white-space: nowrap;
}

nav button.advisor-btn.active {
  background: var(--primary-color);
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 1rem;
}

section#chatSection {
  width: 100%;
  max-width: 900px;
  background-color: var(--chat-bg);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

#chatHeader {
  background: var(--secondary-color);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

#chatHeader h2 {
  margin: 0;
  font-size: 1.2rem;
}

#chatContainer {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message {
  max-width: 80%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--border-radius);
  line-height: 1.4;
}

.message.user {
  align-self: flex-end;
  background: var(--secondary-color);
  color: #ffffff;
}

.message.ai {
  align-self: flex-start;
  background: #e6eef7;
  color: var(--text-color);
}

form#chatForm {
  display: flex;
  padding: 0.5rem;
  background: var(--chat-bg);
  border-top: 1px solid #ccc;
}

form#chatForm input[type="text"] {
  flex: 1;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: var(--border-radius);
}

form#chatForm button {
  margin-left: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: #ffffff;
  cursor: pointer;
}

form#chatForm button:hover,
form#chatForm button:focus {
  background: var(--secondary-color);
  outline: none;
}

footer {
  background-color: var(--primary-color);
  color: #ffffff;
  text-align: center;
  padding: 0.8rem;
  font-size: 0.8rem;
  /* Links im Footer werden standardmäßig sichtbar gemacht */
}

/* Fußzeilen-Links: Kontrastreich und unterstrichen für bessere Sichtbarkeit */
footer a {
  /* Links im Footer sind durch ein warmes Gelb und fett gesetzte Schrift gut sichtbar */
  color: #ffd85f; /* warme Gelbnuance als Kontrast zum blauen Hintergrund */
  text-decoration: underline;
  font-weight: bold;
}

footer a:visited {
  color: #ffd85f;
}

footer a:hover,
footer a:focus {
  color: #ffeb9a;
  text-decoration: underline;
}

/* Screen reader only text */
.sr‑only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}