/* Allgemeine Stile und Layout */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Vollbild-Höhe für die Teleprompter-Anzeige */
}

.controls {
    padding: 10px;
    background-color: #333;
    color: white;
}

.text-controls {
    /* Anordnung der Texteingabe und Datei-Controls */
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 10px;
}

.text-controls textarea {
    flex: 1;
    min-width: 200px;
    padding: 5px;
    font-size: 1em;
}

.scroll-controls {
    /* Anordnung der Scroll- und Anzeige-Buttons */
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.scroll-controls button {
    padding: 8px 12px;
    font-size: 0.9em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.scroll-controls button:hover {
    background-color: #45a049;
}

/* Verändertes Aussehen für deaktivierte Buttons */
.scroll-controls button:disabled {
    background-color: #777;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Teleprompter-Anzeigebereich (große weiße Schrift auf dunklem Hintergrund) */
.teleprompter {
    flex: 1;
    overflow-y: auto; /* Scrollbar anzeigen */
    padding: 20px;
    background: #000;
    color: #fff;
    font-size: 2em;
    line-height: 1.5;
    white-space: pre-wrap; /* Zeilenumbrüche im Text beibehalten */
}

/* Vollbildmodus Anpassungen */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    padding: 30px;
    box-sizing: border-box;
}

/* Textgröße-Slider */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
    border-radius: 4px;
}

.font-size-control label {
    font-size: 0.9em;
    white-space: nowrap;
}

.font-size-control input[type="range"] {
    width: 120px;
}

.font-size-control span {
    font-size: 0.9em;
    min-width: 30px;
    text-align: center;
}

/* Geschwindigkeits-Slider */
.speed-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
    border-radius: 4px;
}

.speed-control label {
    font-size: 0.9em;
    white-space: nowrap;
}

.speed-control input[type="range"] {
    width: 120px;
}

.speed-control span {
    font-size: 0.9em;
    min-width: 20px;
    text-align: center;
}

/* Anzeigen/Ausblenden von Controls im Vollbildmodus */
.fullscreen-controls {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 10px;
    border-radius: 8px;
    z-index: 10000;
    display: flex;
    gap: 5px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.fullscreen-controls:hover {
    opacity: 1;
}

/* Zusätzliche Button für feinere Textgrößen-Kontrolle im Vollbildmodus */
.size-buttons {
    display: flex;
    gap: 5px;
}

.size-buttons button {
    font-size: 0.9em;
    padding: 5px 8px;
    background-color: #4CAF50;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

/* Gruppierung für Anzeigemodi-Buttons */
.display-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Heller Modus für den Teleprompter (Hintergrund weiß, Text schwarz) */
.teleprompter.light {
    background: #fff;
    color: #000;
}

/* Spiegelmodus: Text horizontal spiegeln */
.teleprompter.mirror {
    transform: scaleX(-1);
}

/* Auf-dem-Kopf-Modus: Text um 180° rotieren */
.teleprompter.upside-down {
    transform: rotate(180deg);
}

/* Kombinierter Modus: Spiegelung UND auf dem Kopf */
.teleprompter.mirror.upside-down {
    transform: scaleX(-1) rotate(180deg);
}

/* Wichtig: Wenn im Vollbildmodus, stelle sicher dass die Transformationen funktionieren */
.teleprompter.fullscreen.mirror {
    transform: scaleX(-1);
}

.teleprompter.fullscreen.upside-down {
    transform: rotate(180deg);
}

.teleprompter.fullscreen.mirror.upside-down {
    transform: scaleX(-1) rotate(180deg);
}

/* Hervorhebung für gesprochene Wörter */
.highlight {
    background-color: yellow;
    color: black;
    padding: 0 5px;
    border-radius: 4px;
}

/* Verbesserte Hervorhebung für gesprochene Wörter */
.highlight {
    background-color: rgba(255, 255, 0, 0.7);
    color: black;
    padding: 0 5px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

/* Hervorhebung im Light Mode anpassen */
.teleprompter.light .highlight {
    background-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Status-Indikator für Spracherkennung */
.recognition-active .teleprompter {
    border-left: 5px solid #4CAF50;
}

/* Anpassung für den Vollbildmodus mit entsprechenden Modi */
.fullscreen-controls .display-modes {
    display: flex;
    gap: 5px;
}

/* Responsives Design: auf schmalen Bildschirmen Elemente untereinander anordnen */
@media (max-width: 768px) {
    .text-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .text-controls textarea {
        width: 100%;
    }
    
    .scroll-controls {
        flex-direction: column;
    }
    
    .teleprompter {
        font-size: 1.5em;
    }
    
    .font-size-control {
        width: 100%;
        justify-content: space-between;
    }
    
    .speed-control {
        width: 100%;
        justify-content: space-between;
    }
    
    .display-modes {
        width: 100%;
        justify-content: space-between;
    }
}
