: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 */
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;
}

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

#KleoToeneLogo>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;
}






/* CONTROL ELEMENTS */
.controls {
  width: calc(100% - 40px);
  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;
}




#diktieren {
  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;
}

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

#startButton{
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(87, 167, 12);
  color: rgb(191, 255, 175);
  border: none;
}

#stopButton {
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(167, 12, 12);
  color: rgb(255, 175, 175);
  border: none;
}

#clearButton {
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
  background-color: rgb(167, 95, 12);
  color: rgb(255, 218, 175);
  border: none;
}

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

#micIndicator {
  height: 30px;
  padding: 0px;
  margin: 0;
  font-size: 16px;
  background-color: rgba(87, 167, 12, 0.452);
  color: rgb(191, 255, 175);
  display: flex;
  align-items: center;
  justify-content: center;
}
#micIndicatorStopped {
  height: 30px;
  padding: 0px 5px;
  margin: 0;
  font-size: 14px;
  background-color: rgb(136, 12, 167);
  color: rgb(248, 175, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

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



#result {
  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;
  cursor: text;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

/* Editierbarer Text Styling */
#result[contenteditable="true"]:hover {
  border: 2px solid var(--Blau_Transparent_Mittel);
  box-shadow: 0 2px 8px rgba(0, 89, 255, 0.1);
}

#result[contenteditable="true"]:focus {
  outline: none;
  border: 2px solid var(--Blau_Mittel);
  box-shadow: 0 4px 12px rgba(0, 89, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.679);
}

/* Kontrollfunktionen Styling */
.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0px 0;
    padding: 10px;
    background-color: var(--Blau_Transparent_Schwach);
    border-radius: 0px;
}

.control-label {
    font-size: 16px;
    color: var(--Blau_Dunkel);
    font-weight: 500;
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--Blau_Mittel);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--Blau_Mittel);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Hover-Effekte */
.toggle-switch:hover .slider {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Language Select Styling */
.language-select {
    padding: 8px 12px;
    border: 2px solid var(--Blau_Mittel);
    border-radius: 6px;
    background-color: white;
    color: var(--Blau_Dunkel);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.language-select:hover {
    border-color: var(--Blau_Hell);
    background-color: var(--Blau_Transparent_Schwach);
}

.language-select:focus {
    border-color: var(--Blau_Dunkel);
    box-shadow: 0 0 5px var(--Blau_Transparent_Mittel);
}

/* Mikrofon-Pegelanzeige Styling */
#audioLevelContainer {
    width: calc(100% - 20px);
    margin: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--Blau_Transparent_Schwach);
    padding: 8px;
    border-radius: 6px;
}

.audio-level-bar {
    flex: 1;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--Blau_Mittel);
}

#audioLevelFill {
    height: 100%;
    width: 0%;
    background-color: #00aa00;
    transition: width 0.1s ease-out, background-color 0.3s ease;
    border-radius: 8px;
}

.audio-level-text {
    font-size: 12px;
    color: var(--Blau_Dunkel);
    font-weight: 500;
    white-space: nowrap;
}

/* Rechtschreibprüfung Styling */
#result[spellcheck="true"] {
    border: 2px dashed var(--Blau_Transparent_Mittel);
}

#result[spellcheck="true"]:focus {
    outline: none;
    border: 2px solid var(--Blau_Mittel);
    box-shadow: 0 4px 12px rgba(0, 89, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Visuelle Rückmeldung für Korrekturen */
.spell-corrected {
    background-color: rgba(0, 255, 0, 0.2);
    animation: highlight-correction 2s ease-out;
}

@keyframes highlight-correction {
    0% { background-color: rgba(255, 255, 0, 0.5); }
    100% { background-color: transparent; }
}

/* Anpassung der Button- und Indikator-Breiten für 4 Elemente in einer Reihe */
#startButton, #stopButton, #clearButton, #micIndicator, #micIndicatorStopped {
    width: 25%;
    box-sizing: border-box; /* Ensures width includes padding/border */
}


.beschreibung {
  width: calc(100% - 40px);
  height: calc(100vh - 550px);
  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;
}
