/* ==========================================================================
   TTS-App Control Panel & Extensions Styling (tts-style-18.css)
   ========================================================================== */

#tts-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  background-color: #ffffff;
  color: #222222;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  z-index: 9999;
  transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  #tts-panel {
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-color: #333333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

.tts-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.tts-controls button {
  background-color: #f0f0f0;
  color: #333333;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  .tts-controls button {
    background-color: #2d2d2d;
    color: #ffffff;
  }
}

#tts-btn-play {
  background-color: #0066cc;
  color: #ffffff;
}

#tts-btn-exit {
  flex: 0 0 auto;
  background-color: transparent;
  color: #888888;
}

.tts-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.tts-settings label, .voice-selection-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666666;
}

.tts-settings select, .voice-selection-group select {
  width: 60%;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 12px;
}

.tts-page-nav-container {
  border-top: 1px solid #e0e0e0;
  padding-top: 10px;
  margin-top: 8px;
}

.tts-page-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 80px;
  overflow-y: auto;
}

.tts-page-nav button {
  background-color: #f5f5f5;
  border: 1px solid #dddddd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

/* Interaktion & Hervorhebung */
.tts-sentence {
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.tts-sentence:hover {
  background-color: rgba(0, 102, 204, 0.15);
}

.tts-active-chunk {
  background-color: rgba(255, 235, 59, 0.4);
  border-left: 3px solid #fbc02d;
  padding-left: 4px;
}

.tts-active-sentence {
  background-color: #fff59d !important;
  color: #000 !important;
  outline: 2px solid #fbc02d;
}

/* Modals & Banner */
#tts-help-modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}

.tts-modal-content {
  background: #fff; color: #222; padding: 24px; border-radius: 12px;
  max-width: 450px; width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tts-modal-content table { width: 100%; margin: 16px 0; border-collapse: collapse; }
.tts-modal-content td { padding: 6px 0; border-bottom: 1px solid #eee; }
kbd { background: #eee; padding: 2px 6px; border-radius: 4px; font-family: monospace; }

.tts-reentry-banner {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #0066cc; color: #fff; padding: 12px 20px; border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 9999; display: flex; gap: 12px; align-items: center;
}

.tts-reentry-banner button { background: #fff; color: #0066cc; border: none; padding: 4px 12px; border-radius: 12px; cursor: pointer; font-weight: bold; }

.tts-glossary-term {
  background-color: rgba(255, 193, 7, 0.3);
  border-bottom: 1px dashed #ffa000;
  cursor: help;
}

.tts-inline-translation {
  display: inline-block;
  font-size: 0.88em;
  font-style: italic;
  color: #0066cc;
  margin-left: 6px;
  opacity: 0.9;
}

#tts-panel.tts-minimized {
  width: auto;
  padding: 8px 12px;
  border-radius: 20px;
}

#tts-panel.tts-minimized .tts-settings,
#tts-panel.tts-minimized .voice-selection-group,
#tts-panel.tts-minimized .tts-page-nav-container {
  display: none !important;
}