:root {
    --bg-color: black;
    --text-color: #fff;
    --button-bg: #444;
    --button-hover-bg: #666;
    --progress-bg: #333;
    --progress-fill: #4caf50;
    --progress-height: 15px;
    --font-family: 'Arial', sans-serif;
    --font-size-base: 22px;
}

/* Stellt sicher, dass HTML und Body die volle Höhe einnehmen */
html, body {
  height: 100%; 
  margin: 0;
  padding: 0;
}
 
body {
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertikale Zentrierung */
  align-items: center;     /* Horizontale Zentrierung */
  overflow-y: auto;        /* Ermöglicht das Scrollen */
  font-size: 22px;         /* Größere Standard-Schriftgröße */
  position: relative;      /* Position für den fixierten Container */
}

.text-container {
  text-align: center;
  display: flex;
  flex-direction: row; /* Zeilenweise anordnung von Text und Bild */
  gap: 20px;           /* Mehr Abstand zwischen Text und Bild */
  width: 100%;          /* Breiter für kleine Bildschirme */
  align-items: center;
  word-wrap: break-word; 
  white-space: normal; 
  max-bottom: 15%;
  overflow: auto;
}

/* width */
.text-container::-webkit-scrollbar {
  width: 20px;
}

/* Track */
.text-container::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px grey; 
  border-radius: 10px;
}
 
/* Handle */
.text-container::-webkit-scrollbar-thumb {
  background: red; 
  border-radius: 10px;
}

/* Handle on hover */
.text-container::-webkit-scrollbar-thumb:hover {
  background: #b30000; 
}

.image-container {
  flex: 0 1 30%; /* Bild nimmt maximal 30% der Breite ein */
  text-align: center;
}

.chat-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.input-container {
  opacity: 0;
  transform: translateY(50px);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;
  animation: slideIn 0.5s forwards;
}

input {
  padding: 1em; 
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  width: 90%;
  max-width: 350px;
  box-sizing: border-box;
}

button {
  background-color: var(--button-bg);
  color: var(--text-color);
  padding: 1em;
  border: none;
  border-radius: 8px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 20px;
}

button:hover {
  background-color: var(--button-hover-bg);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CSS für Fade-In und Fade-Out */
.fade-in {
  animation: fadeIn 0.5s forwards;
}

.fade-out {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Fortschrittsleiste */
#progress-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--progress-bg);
    height: var(--progress-height);
    display: none; /* Standardmäßig ausgeblendet */
    z-index: 1000; /* Sicherstellen, dass es oben bleibt */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3); /* Optional: Schatten hinzufügen */
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    transition: width 0.2s ease; /* Sanfter Übergang beim Aktualisieren */
}

/* Optional: Verbesserte Farben und Schatten für ein moderneres Aussehen */
#progress-bar-container {
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

#progress-bar {
  background: linear-gradient(90deg, #4caf50, #81c784);
}

.fade-in-progress {
  animation: fadeInProgress 0.5s forwards;
}

.fade-out-progress {
  animation: fadeOutProgress 0.5s forwards;
}

@keyframes fadeInProgress {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOutProgress {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* CSS für beschleunigtes Tippen */
.holding {
  background-color: rgba(255, 255, 255, 0.2);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.dialogue-entry {
  padding: 10px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.dialogue-entry h3 {
  margin: 0 0 10px;
}

.dialogue-entry p {
  margin: 5px 0;
}

/* Fixiere den Button am unteren Rand */
.fixed-button-container {
  position: fixed;
  bottom: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Allgemeine Schriftgröße und Schriftart für den Antwort-Container */
#response-container {
    font-size: var(--font-size-base); /* 22px */
    font-family: var(--font-family);
    line-height: 1.5;
    white-space: pre-wrap; /* Erlaubt Zeilenumbrüche und Leerzeichen */
}

/* Stil für die Linien */
.line {
    font-size: 1.5rem; /* Anpassen nach Bedarf, z.B. 1.5rem für 24px */
    overflow: hidden;
    white-space: normal; 
    display: block; 
    word-wrap: break-word; 
    margin-bottom: 10px; /* Optional: Abstand zwischen den Linien */
}

/* Cursor-Styling */
.cursor {
  display: inline-block;
  /* Entferne background-color, da wir einen Zeichen-Cursor verwenden */
  color: black;
  animation: blink 1s steps(2, start) infinite;
  margin-left: 2px;
  vertical-align: bottom; /* Passt die vertikale Ausrichtung an */
  font-family: monospace; /* Einheitliche Schriftart für den Cursor */
  font-size: 1em; /* Passende Schriftgröße */
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  50.01%, 100% {
    opacity: 0;
  }
}

/* Styling für Choice-Container */
.choice-container {
  margin-top: 20px;
}

.choice-container button {
  margin-right: 10px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
}

/* Optional: Styling für Undo-Span */
/*.undo-span {
/*  font-style: italic;
/*  color: gray;
/*}

/* Optimierungen für Mobilgeräte */
@media (max-width: 768px) {
  body {
    font-size: 16px; 
  }
  
  .line {
    font-size: 1.8rem; 
  }
  
  input {
    font-size: 1.3rem; 
  }
  
  button {
    font-size: 1.3rem; 
    padding: 1.2em; 
  }
  
  .text-container {
    gap: 25px;
  }

  .text-container {
    flex-direction: column; /* Text und Bild untereinander auf kleineren Bildschirmen */
  }

  .image-container {
    width: 80%; /* Bilder auf kleinen Geräten breiter */
  }
}

/* Optimierungen für sehr kleine Geräte */
@media (max-width: 480px) {
  body {
    font-size: 14px; 
    padding: 0 5px;
  }
  
  .line {
    font-size: 1.5rem; 
  }
  
  input {
    font-size: 1.2rem;
  }
  
  button {
    font-size: 1.2rem;
    padding: 1em;
  }

  /* Für Video-Leiste */
  .video-bar {
    display: block;
  }
}

/* Container für Video und Text */
.container {
    position: fixed; /* Container bleibt unten fixiert */
    bottom: 10px; /* Abstand vom unteren Bildschirmrand */
    left: 10px; /* Abstand vom linken Bildschirmrand */
    display: none; /* Setzt Video und Text nebeneinander */
    align-items: flex-end; /* Inhalt am unteren Rand ausrichten */
    justify-content: space-between; /* Platz zwischen Video und Text */
    width: calc(100% - 20px); /* Volle Breite minus Abstand links und rechts */
    z-index: 999; /* Über anderen Elementen */
    background: none; /* Kein Hintergrund für den Container */
    padding: 0; /* Keine zusätzliche Polsterung */
}

/* Video */
.video-overlay {
    flex: 0 0 auto; /* Video behält feste Größe */
    width: 30%; /* Video nimmt 20% der Breite ein */
    max-width: 220px; /* Maximale Breite des Videos */
    height: auto; /* Beibehaltung des Seitenverhältnisses */
    margin-right: 10px; /* Abstand zwischen Video und Textbox */
    position: relative; /* Für exaktes Platzieren */
    bottom: 0; /* Sicherstellen, dass das Video unten bleibt */
}

.avatar-video {
    width: 100%; /* Passt das Video an die Breite des Containers an */
    height: auto; /* Beibehaltung des Seitenverhältnisses */
    border-radius: 10px; /* Optional: Runde Ecken für das Video */
    object-fit: cover; /* Video passt sich gut an */
}

/* Textbox */
.text-overlay-container {
    flex: 1; /* Textbox nimmt den restlichen Platz ein */
    display: flex; /* Flexbox für zentrierten Inhalt */
    justify-content: flex-end; /* Text rechtsbündig anordnen */
    align-items: flex-end; /* Text am unteren Rand ausrichten */
    position: relative;
    height: auto; /* Automatische Höhe */
}

.text-overlay {
    background-color: #fff; /* Weißer Hintergrund */
    color: #333; /* Dunkler Text */
    border-radius: 10px; /* Runde Ecken */
    padding: 15px; /* Polsterung innerhalb der Box */
    width: 80%; /* Textbox nimmt maximal 70% der Breite ein */
    height: auto; /* Passt sich automatisch an den Text an */
    text-align: left; /* Text linksbündig */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); /* Optional: Schatten */
    font-size: 1rem; /* Schriftgröße */
    line-height: 1.5; /* Zeilenhöhe für bessere Lesbarkeit */
    word-wrap: break-word; /* Lange Wörter umbrechen */
    overflow: hidden; /* Text bleibt in der Box */
}

.text-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.random-text {
    font-size: 1rem;
    font-weight: normal;
}