/* letzte Bearbeitung durch autopen_radia wegen Konzept lillian-page_doku.txt Schwebendes Logo (FK-Stand 21545cd) am 02.12.2026 um 04:04 */
/* ============================================================
   Designvorlage: /lillian — Chat-Interface
   Erstellt: Otto, Systemdesigner (visuals@jenkins)
   Referenz: bericht-page (Laurie), visuals_doku.txt Kap.5-7
   Datum: 10.04.2026
   Frontend: Radia, Schnittstellentechnikerin (lillian-page@jenkins)
   ============================================================ */

/* --- 6.1 Layout — body --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #ffffff;
  color: #212529;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  padding: 24px 16px 48px;
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* --- 6.2 Kopfbereich --- */
h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #6c757d;
  font-size: 0.8rem;
  margin-bottom: 18px;
}

/* --- 6.4 Layout — .page-layout --- */
.page-layout {
  display: flex;
  align-items: flex-start;
  gap: 74px; /* 119 / 1.618 ≈ 73.5 → 74 px */
  flex: 1;
  min-height: 0;
}

.action-area {
  flex-shrink: 0;
  width: 119px;
  background: transparent;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* --- 6.3 Ankerelement 0 — Action-Kreis --- */
#triggerBtn {
  width: 119px;
  height: 119px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.3s ease;
}

#triggerBtn.idle {
  background: #27ae60;
  animation: none;
}

#triggerBtn.generating {
  background: #f1c40f;
  animation: pulse-fast 0.6s ease-in-out infinite;
}

#triggerBtn.done {
  background: #27ae60;
  animation: none;
}

#triggerBtn.disconnected {
  background: #e74c3c;
  animation: none;
}

@keyframes pulse-fast {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

.action-label {
  font-size: 0.72rem;
  color: #6c757d;
  text-align: center;
}

/* --- Auth-Bereich --- */
.auth-area {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1;
}

.auth-area label {
  font-size: 0.85rem;
  color: #6c757d;
}

.auth-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #212529;
  background: #ffffff;
}

.auth-input:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.15);
}

.auth-btn {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  background: #27ae60;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-btn:hover {
  background: #219a52;
}

.auth-error {
  color: #e74c3c;
  font-size: 0.8rem;
  display: none;
}

/* --- Chat-Bereich (Karten-Stil aus 6.6) --- */
.chat-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #dee2e6;
  background: #e9ecef;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-status {
  font-size: 0.72rem;
  font-weight: 400;
  padding: 3px 10px;
  border-radius: 12px;
  color: #ffffff;
}

.session-status.active {
  background: #27ae60;
}

.session-status.disconnected {
  background: #e74c3c;
}

.session-status.connecting {
  background: #f1c40f;
  color: #212529;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- Nachrichtenblasen --- */
.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: #27ae60;
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.message.assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #212529;
  border: 1px solid #dee2e6;
  border-bottom-left-radius: 3px;
}

.message.error {
  align-self: center;
  background: #fdf0f0;
  color: #e74c3c;
  border: 1px solid #f5c6cb;
  font-size: 0.85rem;
  max-width: 90%;
  text-align: center;
}

.message-meta {
  font-size: 0.72rem;
  color: #adb5bd;
  margin-top: 4px;
}

.message.user .message-meta {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

/* --- Ladeanzeige --- */
.typing-indicator {
  align-self: flex-start;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  display: none;
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #adb5bd;
  margin: 0 2px;
  animation: typing 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Eingabebereich --- */
.chat-input-area {
  flex-shrink: 0;
  padding: 14px 18px;
  border-top: 1px solid #dee2e6;
  background: #e9ecef;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #212529;
  background: #ffffff;
  resize: none;
  min-height: 40px;
  max-height: 120px;
}

.chat-input:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.15);
}

.chat-input::placeholder {
  color: #adb5bd;
}

.chat-input:disabled {
  background: #e9ecef;
  cursor: not-allowed;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #27ae60;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.send-btn:hover {
  background: #219a52;
}

.send-btn:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

/* --- Bewertungs-Leiste --- */
.rating-bar {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  align-self: flex-start;
}

.rating-btn {
  height: 32px;
  border-radius: 16px;
  padding: 0 14px;
  border: 1px solid #dee2e6;
  background: transparent;
  color: #6c757d;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  overflow: hidden;
  white-space: nowrap;
}

.rating-btn .btn-label {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.3s ease, opacity 0.3s ease;
}

.rating-btn.active .btn-label {
  max-width: 200px;
  opacity: 1;
}

.rating-btn.positive:hover {
  background: rgba(39, 174, 96, 0.08);
  border-color: #27ae60;
  color: #27ae60;
}

.rating-btn.negative:hover {
  background: rgba(231, 76, 60, 0.08);
  border-color: #e74c3c;
  color: #e74c3c;
}

.rating-btn.positive.active {
  background: #27ae60;
  border-color: #27ae60;
  color: #ffffff;
}

.rating-btn.negative.active {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #ffffff;
}

.rating-btn.disabled {
  opacity: 0.6;
  pointer-events: none;
  border-color: #e9ecef;
  color: #adb5bd;
}

/* --- 6.7 Footer --- */
footer {
  text-align: right;
  padding: 16px 24px;
  font-size: 0.72rem;
  color: #adb5bd;
  margin-top: 14px;
  flex-shrink: 0;
}

/* --- 6.8 Responsive (max-width 600px) --- */
@media (max-width: 600px) {
  body {
    padding: 16px 10px 32px;
  }

  .page-layout {
    flex-direction: column;
    gap: 14px;
  }

  .action-area {
    flex-direction: row;
    width: 100%;
    gap: 14px;
  }

  #triggerBtn {
    width: 80px;
    height: 80px;
    font-size: 12px;
  }

  .message {
    max-width: 90%;
  }
}
.start-versteckt { display: none; }

/* --- Token anfordern (30.11.2026) --- */
.anfrage { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 560px; align-self: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid #dee2e6; }
.anfrage .auth-input { width: 100%; max-width: none; box-sizing: border-box; }
.anfrage.start-versteckt { display: none; }
.anfrage-links { display: flex; flex-wrap: wrap; gap: 24px; font-size: 0.85rem; }
.hinweise { max-width: 680px; margin: 0 auto 16px; line-height: 1.6; }
.zustimmung { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 0.85rem; }
.anfrage-meldung { font-size: 0.9rem; }
.anfrage-meldung.ok { color: #1e7e46; }
.anfrage-meldung.fehler { color: #c0392b; }
.hinweise p { margin: 0 0 14px; }
.anfrage-links a, .hinweise a { color: #1e7e46; }
.token-bereich { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.token-bereich.start-versteckt { display: none; }
.zustimmung.schon { justify-content: center; }
.anfrage-links { justify-content: center; }
.anfrage-links.start-versteckt { display: none; }

/* Schwebendes Zeichenlogo: seit 02.12.2026 gemeinsamer Baustein (/zeichenlogo/v1/), Platz unten kommt vom Baustein */
