/* BNI Chatbot — Fullpage Chat Layout */

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

:root {
  --bni-red: #CC0000;
  --bni-red-dark: #aa0000;
  --bni-red-light: #fff0f0;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --radius: 12px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Chat Container — volle Höhe */
.chat-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

/* Header */
.chat-header {
  width: 100%;
  background: var(--bni-red);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chat-header-logo {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--bni-red);
  flex-shrink: 0;
}
.chat-header-info h1 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}
.chat-header-info p {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Messages Area — füllt den gesamten verfügbaren Platz */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Nachrichten zentriert mit max-width für Lesbarkeit */
.chat-messages-inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Welcome Message */
.chat-welcome {
  text-align: center;
  padding: 40px 16px 24px;
}
.chat-welcome-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.chat-welcome h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.chat-welcome p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Quick Questions */
.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 16px 16px;
}
.quick-btn {
  background: var(--bni-red-light);
  color: var(--bni-red);
  border: 1px solid rgba(204,0,0,0.15);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.quick-btn:hover {
  background: var(--bni-red);
  color: white;
  border-color: var(--bni-red);
}

/* Message Bubbles */
.message {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.message-user {
  align-self: flex-end;
}
.message-assistant {
  align-self: flex-start;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  word-wrap: break-word;
}
.message-user .message-bubble {
  background: var(--bni-red);
  color: white;
  border-bottom-right-radius: 4px;
}
.message-assistant .message-bubble {
  background: #f3f4f6;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.message-bubble p { margin: 0 0 10px 0; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ul, .message-bubble ol {
  margin: 8px 0;
  padding-left: 22px;
}
.message-bubble li {
  margin-bottom: 5px;
  line-height: 1.5;
}
.message-bubble strong { font-weight: 600; }

.message-sources {
  font-size: 0.75rem;
  color: var(--text-light);
  padding: 2px 4px;
}

.message-time {
  font-size: 0.72rem;
  color: var(--text-light);
  padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
  background: #f3f4f6;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* Input Area — fixiert am unteren Rand */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--surface);
  flex-shrink: 0;
}
.chat-input-wrapper {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus {
  border-color: var(--bni-red);
}
.chat-input::placeholder {
  color: var(--text-light);
}
.chat-send {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bni-red);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--bni-red-dark); }
.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chat-send svg {
  width: 20px;
  height: 20px;
}

/* Footer */
.chat-footer {
  text-align: center;
  padding: 8px;
  font-size: 0.7rem;
  color: var(--text-light);
  flex-shrink: 0;
}
.chat-footer a {
  color: var(--bni-red);
  text-decoration: none;
}

/* Hidden */
.hidden { display: none !important; }

/* Desktop: Nachrichten etwas schmaler für bessere Lesbarkeit */
@media (min-width: 1024px) {
  .message { max-width: 65%; }
  .chat-messages { padding: 24px 40px; }
}

/* Mobile */
@media (max-width: 640px) {
  .message { max-width: 90%; }
  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 12px 16px; }
  .chat-welcome { padding: 24px 12px 16px; }
  .chat-welcome h2 { font-size: 1.1rem; }
}
