/* === Module: Globale Styles (ID: 3) === */
:root {
    --primary-color: #cfc889; /* Dunkles Holz/Erde */
    --accent-color: #D4AF37; /* Gold */
    --secondary-color: #ccb1a7; /* Helleres Braun */
    --bg-light: #FDFBF7; /* Creme */
    --text-dark: #333333;
    --text-light: #ffffff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --spacing: 4rem;
    --navbar-height: 100px;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.navbar {
    background-color: hsl(131, 65%, 19%);
    background-image: url('/uploads/seitenelemente/bgpattern.png') repeat;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
}

.logoimg img {
    height: 100px;
}

/* Spacer Element um Platz für die fixed Navigation zu schaffen */
.nav-spacer {
    height: var(--navbar-height);
    width: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}



.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logobig {
    height: 500px;
    margin: 2rem auto 0 auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #ccb1a7;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color);
}

.btn-cta-nav {
    background-color: var(--primary-color);
    color: var(--text-dark) !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-cta-nav:hover {
    background-color: var(--secondary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: #e0e0e0;
    padding-top: 4rem;
}

.grid-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer h4 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.footer-bottom {
    background-color: #4a332a;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
}



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