/* === Module: Globale Styles (ID: 3) === */
/* Neues CSS Modul */



/* === Module: KI Assistent (ID: 4) === */
.ai-assist-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.tts-toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
  gap: 0.5rem;
}

.btn-new-conversation {
  padding: 0.5rem 1rem;
  border: 2px solid #b38e4d; /* Omi Spa Gold */
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 600;
  color: #b38e4d;
}

.btn-new-conversation:hover:not(:disabled) {
  background: #b38e4d;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(179, 142, 77, 0.3);
}

.btn-new-conversation:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-tts-toggle {
  width: 40px;
  height: 40px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  color: #666;
}

.btn-tts-toggle:hover {
  border-color: #b38e4d;
  transform: scale(1.1);
}

.btn-tts-toggle.active {
  background: #b38e4d; /* Gold statt Blau */
  border-color: #b38e4d;
  color: white;
}

.btn-tts-toggle.active.playing {
  animation: pulse-tts 1.5s ease-in-out infinite;
}

@keyframes pulse-tts {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(179, 142, 77, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(179, 142, 77, 0);
  }
}

.prompt-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prompt-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.prompt-input:focus {
  outline: none;
  border-color: #b38e4d;
}

.prompt-input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.button-group {
  display: flex;
  gap: 0.5rem;
}

.btn-send,
.btn-clear,
.btn-voice {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
}

.btn-voice {
  background: #e34c4c; /* Rot für Aufnahme beibehalten */
  color: white;
  min-width: 140px;
}

.btn-voice:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(227, 76, 76, 0.4);
}

.btn-voice.recording {
  background: #ff5722;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.btn-send {
  background: #b38e4d; /* Gold statt Blau */
  color: white;
  flex: 1;
}

.btn-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(179, 142, 77, 0.4);
}

.btn-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-clear {
  background: #e4e6eb;
  color: #4b4b4b;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  min-height: 200px;
}

.chat-message {
  border-radius: 12px;
  padding: 0.75rem;
  animation: fadeIn 0.3s ease;
  max-width: 85%;
}

.user-message {
  background: #f0f2f5; /* Neutrales Hellgrau */
  align-self: flex-start;
  border: 1px solid #e0e0e0;
}

.assistant-message {
  background: #333333; /* Dunkles Anthrazit für edlen Kontrast */
  color: white;
  align-self: flex-end;
  border: 1px solid #1a1a1a;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-message .message-header {
  color: #555;
}

.assistant-message .message-header {
  color: #b38e4d; /* Goldener Header in der dunklen Sprechblase */
}

.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.assistant-message .message-content {
  color: white;
}

.btn-speak-message {
  background: rgba(179, 142, 77, 0.2);
  border: 1px solid rgba(179, 142, 77, 0.4);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  color: white;
}

/* --- AI Assistant Styles --- */

.btn-assistant {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: #b38e4d;
    font-weight: 400;
}

#aiAssist {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 520px;
    max-width: 90vw;
    height: 80vh;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#aiAssist.visible {
    display: flex;
}

.ai-popup-header {
    background: #333333; /* Dunkelgrau statt Blau */
    border-bottom: 2px solid #b38e4d; /* Goldene Trennlinie */
    color: #b38e4d; /* Goldene Schrift */
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.ai-popup-header-title {
  cursor: move;
}

.ai-popup-close {
    background: rgba(179, 142, 77, 0.2);
    border: none;
    color: #b38e4d;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

.ai-popup-content {
    padding: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #f9f9f9;
}