:root {
  --Blau_Hell: #b6d0ff;
  --Blau_Mittel: rgb(0, 89, 255);
  --Blau_Dunkel: rgb(0, 28, 80);
  --Blau_Transparent_Schwach: rgba(182, 208, 255, 0.7);
  --Blau_Transparent_Mittel: rgba(182, 208, 255, 0.5);
  --Blau_Transparent_Starck: rgba(182, 208, 255, 0.3);
}

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;

  overflow: hidden;
  font-family: sans-serif;

  display: flex;
  flex-direction: column;
  align-items: center;

  background-color: rgb(193, 225, 255);
}

header {
  width: calc(100% - 0px);
  /* max-width: 600px; */
  height: 60px;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--Blau_Dunkel);
  border: 1px solid var(--Blau_Dunkel);
  color: var(--Blau_Hell);
  z-index: 30;
  padding: 30px  0px -20px 0px;
}

header > a {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 20px;
  gap: 10px;
  transition: all 0.3s ease;
}

header > a > h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0px;
  padding: 0;
  color: #7ec1ff;
}

header > a > h2 {
  font-size: 18px;
  font-weight: 300;
  margin: 0px;
  padding: 0;
  color: #0062be;
}

#KleoToeneLogo > img {
  width: 100px;
  height: 50px;
  margin: 0px;
  transition: all 0.3s ease;
}

#KleoDictaLogo > img {
  width: auto;
  height: 40px;
  margin: 0px;
  transition: all 0.3s ease;
}

@media screen and (max-width: 600px) {
  header > a > h1,
  header > a > h2 {
    font-size: 0px;
  }
}

/* LOGO CONTAINER Einstellungen */
.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.settings-hint:hover {
  background-color: transparent;
}

.settings-hint {
  font-size: 16px;
  color: var(--Blau_Hell);
  background-color: transparent;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.settings-hint > p {
  font-size: 12px;
  margin: 0;
  padding: 0;
  color: var(--Blau_Hell);
}

.gear-icon {
  font-size: 22px;
  animation: rotate 6s linear infinite;
  margin: 5px;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.logo-container:hover .gear-icon {
  font-size: 30px;
  margin: 0px;
  animation-duration: 2s;
  transition: all 0.93s ease-in-out;
}

h1 {
  font-size: 19px;
  font-weight: 100;
  margin: 0px;
  padding: 0;
}

.controls {
  width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: -5px 0px 0px 0px;
  padding: 20px;
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  opacity: 0;
  transition: all 0.5s ease-in-out;
  z-index: 10;
  pointer-events: none;
}

.controls.show {
  transform: translateX(-50%) translateY(0);
  opacity: 0.9;
  pointer-events: auto;
  z-index: 10;
}

h2 {
  font-size: 20px;
  color: #0467a3;
  margin: 10px 0px 0px 0px;
  padding: 0 10px;
}

.control-group {
  display: flex;
  flex-direction: column;
  padding: 0 10px 10px 10px;
  margin: -4px;
}

.control-group label {
  font-weight: normal;
  color: #2669bf;
}

.control-group input[type="range"] {
  width: calc(100% - 20px);
  color: var(--Blau_Transparent_Schwach);
}

.control-group input[type="rate"] {
  width: calc(100% - 20px);
  color: var(--Blau_Transparent_Schwach);
}

.control-group span {
  font-size: 16px;
  color: var(--Blau_Transparent_Schwach);
  text-align: right;
}

/* #langControl {
  display: none;
} */

form {
  width: calc(100% - 0px);
  height: calc(100% - 0px);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0px;
  transition: all 0.5s ease-in-out;
  background-color: #000e1d4d;
}

form.pushed-down {
  margin-top: calc(100vh - 100px); 
}

#lesenButton {
  width: calc(25% - 0px);
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(87, 167, 12);
  color: rgb(191, 255, 175);
  box-sizing: border-box;
  border: none;
  transition: background 0.2s, color 0.2s;
}

#pauseButton {
  width: calc(25% - 0px);
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(149, 12, 167);
  color: rgb(242, 175, 255);
  box-sizing: border-box;
  border: none;
  transition: background 0.2s, color 0.2s;
}

#stopButton {
  width: calc(25% - 0px);
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(167, 12, 12);
  color: rgb(255, 175, 175);
  box-sizing: border-box;
  border: none;
  transition: background 0.2s, color 0.2s;
}

#clearButton {
  width: calc(25% - 0px);
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(167, 144, 12);
  color: rgb(255, 250, 175);
  box-sizing: border-box;
  border: none;
  transition: background 0.2s, color 0.2s;
}

#speedPresets {
  width:fit-content;
  height: 30px;
  padding: 5px 10px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgba(0, 150, 200, 0);
  color: rgb(0, 39, 53);
  z-index: auto;
}

#lesenButton:hover{
  color: rgb(87, 167, 12);
  background-color: rgb(191, 255, 175);
}


#pauseButton:hover{
  color: rgb(141, 12, 167);
  background-color: rgb(239, 175, 255);
}


#stopButton:hover {
  color: rgb(167, 12, 12);
  background-color: rgb(255, 175, 175);
}

#clearButton:hover {
  color: rgb(167, 164, 12);
  background-color: rgb(255, 250, 175);
}

#speedPresets:hover {
  color: rgb(1, 65, 87);
  background-color: rgba(200, 240, 255, 0);
}

textarea {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 10px;
  font-size: 18px;
  font-family: sans-serif;
  line-height: 1.4;
  background-color: rgba(182, 208, 255, 0.4);
  color: var(--Blau_Dunkel);
  position: relative;
  z-index: 1;
  resize: none;
  box-sizing: border-box;
}

/* Theme Styles */
body.light-theme {
  background-color: #f0f0f0;
}

body.light-theme header {
  background-color: var(--Blau_Mittel);
}

body.light-theme .controls {
  background-color: rgba(255, 255, 255, 0.9);
}

body.light-theme textarea {
  background-color: rgba(255, 255, 255, 0.9);
}

/* Speed Presets Dropdown */
.speed-preset-dropdown {
  position: relative;
  display: inline-block;
  width: 20%;
}

.speed-preset-content {
  display: none;
  position: absolute;
  top: 30px;
  left: 0px;
  right: 0px;
  background-color: rgb(2 39 105);
  border: 0px solid var(--Blau_Dunkel);
  z-index: 30;
}

.speed-preset-content button {
  width: 100%;
  padding: 10px;
  border: none;
  background: rgb(0, 150, 200);
  color: #01112e;
  cursor: pointer;
  font-size: 12px;
}

.speed-preset-content button:hover {
  background-color: var(--Blau_Transparent_Schwach);
}

.speed-preset-dropdown.show .speed-preset-content {
  display: block;
}

/* Text highlighting */
.highlight {
  background-color: yellow;
  color: black;
}

/* Highlighting-Indikator */
.highlighting-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 0, 0.8);
  color: black;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 1000;
  display: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.highlighting-indicator.show {
  display: block;
}

/* Lesezeichen Status */
.bookmark-status {
  position: fixed;
  top: 50px;
  right: 10px;
  background-color: rgba(0, 150, 255, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 1000;
  display: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bookmark-status.show {
  display: block;
}

/* Textarea mit Highlighting-Unterstützung */
.textarea-container {
  position: relative;
  width: 100%;
  height: calc(100% - 0px);
  margin: 0;
}

.textarea-container textarea {
  position: relative;
  z-index: 2;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--Blau_Hell);
}

.textarea-highlighting {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 10px;
  font-size: 18px;
  font-family: sans-serif;
  line-height: 1.4;
  border: 2px solid transparent;
  background-color: transparent;
  color: rgba(0, 0, 0, 0.1);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
}

.textarea-highlighting .highlight-span {
  background-color: rgba(255, 255, 0, 0.7);
  color: rgba(0, 0, 0, 0.8);
  animation: highlight-pulse 1.2s ease-in-out;
  border-radius: 3px;
  padding: 1px 2px;
  box-shadow: 0 0 8px rgba(255, 255, 0, 0.4);
}

@keyframes highlight-pulse {
  0% {
    background-color: rgba(255, 255, 0, 0.4);
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.3);
  }
  50% {
    background-color: rgba(255, 255, 0, 0.9);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.6);
  }
  100% {
    background-color: rgba(255, 255, 0, 0.8);
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.3);
  }
}

/* Fortschrittsanzeige für lange Texte */
.chunk-progress {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: rgba(0, 28, 80, 0.95);
    border: 2px solid var(--Blau_Hell);
    border-radius: 8px;
    padding: 10px;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chunk-progress.show {
    opacity: 1;
    visibility: visible;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(182, 208, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--Blau_Hell), var(--Blau_Mittel));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    color: var(--Blau_Hell);
    font-size: 12px;
    text-align: center;
    font-weight: bold;
}

@media (max-width: 600px) {
    .chunk-progress {
        width: 90%;
        top: 100px;
    }
}

.beschreibung {
  width: calc(100% - 40px);
  height: calc(100vh - 620px);
  padding: 20px;
  margin: 10px 0;
  background: var(--Blau_Transparent_Schwach);
  border-radius: 10px;
  color: var(--Blau_Dunkel);
  font-size: 1.08em;
  box-shadow: 0 2px 8px #b6d0ff44;
  overflow-y: auto;
  transition: all 0.3s ease;
  font-size: 16px;
}
