/* Script-Toggle Container Styling */
.script-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px auto;
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  border: 1px solid rgba(255, 140, 0, 0.3);
  box-shadow: 0 0 10px rgba(255, 140, 0, 0.2);
  max-width: fit-content;
}

.script-toggle-container label {
  margin-right: 10px;
  font-size: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  margin: 0 8px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  transition: .4s;
  border-radius: 24px;
  border: 1px solid rgba(255, 140, 0, 0.5);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: rgba(255, 140, 0, 0.8);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: rgba(99, 29, 118, 0.5);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.7rem;
  margin: 0 5px;
}

/* RTL-Anpassungen für den Toggle */
html[dir="rtl"] .script-toggle-container label {
  margin-right: 0;
  margin-left: 10px;
}

html[dir="rtl"] .toggle-slider:before {
  left: auto;
  right: 3px;
}

html[dir="rtl"] input:checked + .toggle-slider:before {
  transform: translateX(-24px);
}

/* Spezielle Styling für Wörter mit separaten Buchstaben */
.word.separated-view {
  letter-spacing: 2px;
}

/* Animationseffekt beim Umschalten */
.word {
  transition: letter-spacing 0.3s ease;
}

/* Responsive Design */
@media (max-width: 600px) {
  .script-toggle-container {
    padding: 5px 10px;
  }
  
  .script-toggle-container label,
  .toggle-label {
    font-size: 0.65rem;
  }
  
  .toggle-switch {
    width: 40px;
    height: 20px;
  }
  
  .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 2px;
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(20px);
  }
  
  html[dir="rtl"] input:checked + .toggle-slider:before {
    transform: translateX(-20px);
  }
  
  .word.separated-view {
    letter-spacing: 1px;
  }
}
