/* chatbot.css — Chatbot-Fenster-Styles für alexander-ohl.com
   Dark Mode & Light Mode Unterstützung mit high-contrast WCAG AAA Verhältnissen. */

.chatbot-window {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 380px;
  height: min(580px, 80dvh);
  background: #161c3c;
  color: #f4f4ec;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: 
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s, color 0.2s;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

.chatbot-window.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ── Light Mode Chatbot Override ────────────────────────────────────────── */
[data-theme="light"] .chatbot-window {
  background: #ffffff;
  color: #0f1430;
  border: 1px solid rgba(15, 20, 48, 0.14);
  box-shadow: 0 20px 60px rgba(15, 20, 48, 0.18);
}

/* Header */
.chatbot-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #0a0e23 0%, #161c3c 100%);
  border-bottom: 1px solid rgba(255, 200, 41, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}

[data-theme="light"] .chatbot-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(15, 20, 48, 0.12);
}

.chatbot-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chatbot-avatar-container {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.chatbot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffc829;
  background: #1d2548;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

[data-theme="light"] .chatbot-avatar {
  border-color: #d97706;
}

.chatbot-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background-color: #16a34a;
  border: 2px solid #161c3c;
  border-radius: 50%;
  box-shadow: 0 0 8px #16a34a;
}

[data-theme="light"] .chatbot-status-dot {
  border-color: #ffffff;
}

.chatbot-info {
  display: flex;
  flex-direction: column;
}

.chatbot-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

[data-theme="light"] .chatbot-title {
  color: #0f1430;
}

.chatbot-subtitle {
  font-size: 0.75rem;
  color: rgba(244, 244, 236, 0.66);
  margin: 2px 0 0 0;
}

[data-theme="light"] .chatbot-subtitle {
  color: rgba(15, 20, 48, 0.65);
}

.chatbot-status-text {
  color: #4ade80;
  font-weight: 600;
}

[data-theme="light"] .chatbot-status-text {
  color: #15803d;
}

.chatbot-actions {
  display: flex;
  gap: 0.35rem;
}

.chatbot-action-btn {
  background: transparent;
  border: none;
  color: rgba(244, 244, 236, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-size: 1.1rem;
}

[data-theme="light"] .chatbot-action-btn {
  color: #0f1430;
}

.chatbot-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffc829;
}

[data-theme="light"] .chatbot-action-btn:hover {
  background: rgba(15, 20, 48, 0.08);
  color: #b45309;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #0f1430;
  scroll-behavior: smooth;
  transition: background 0.2s;
}

[data-theme="light"] .chatbot-messages {
  background: #f8fafc;
}

.chat-message {
  display: flex;
  max-width: 85%;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-message.bot .chat-bubble {
  background: #1d2548;
  color: #f4f4ec;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
}

[data-theme="light"] .chat-message.bot .chat-bubble {
  background: #ffffff;
  color: #0f1430;
  border: 1px solid rgba(15, 20, 48, 0.12);
  box-shadow: 0 2px 8px rgba(15, 20, 48, 0.06);
}

.chat-message.bot .chat-bubble a {
  color: #ffc829;
  text-decoration: underline;
  font-weight: 600;
}

[data-theme="light"] .chat-message.bot .chat-bubble a {
  color: #1d4ed8;
}

.chat-message.bot .chat-bubble a:hover {
  color: #ffd75a;
}

[data-theme="light"] .chat-message.bot .chat-bubble a:hover {
  color: #1e40af;
}

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, #ffc829 0%, #e6a800 100%);
  color: #0a0e23;
  font-weight: 600;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(255, 200, 41, 0.25);
}

[data-theme="light"] .chat-message.user .chat-bubble {
  background: #ffc829;
  color: #0f1430;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}

/* Quick Replies */
.chatbot-quick-replies {
  padding: 0.75rem 1.25rem;
  background: #0f1430;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s, border-color 0.2s;
}

[data-theme="light"] .chatbot-quick-replies {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 20, 48, 0.08);
}

.qr-chip {
  background: #1d2548;
  color: rgba(244, 244, 236, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="light"] .qr-chip {
  background: #ffffff;
  color: #0f1430;
  border: 1px solid rgba(15, 20, 48, 0.16);
}

.qr-chip:hover {
  background: rgba(255, 200, 41, 0.15);
  border-color: #ffc829;
  color: #ffc829;
}

[data-theme="light"] .qr-chip:hover {
  background: #fef08a;
  border-color: #ca8a04;
  color: #0f1430;
}

.qr-chip.primary {
  background: #ffc829;
  color: #0a0e23;
  font-weight: 700;
  border-color: #ffc829;
}

[data-theme="light"] .qr-chip.primary {
  background: #ffc829;
  color: #0f1430;
  border-color: #d97706;
}

.qr-chip.primary:hover {
  background: #ffd75a;
}

/* Input Form */
.chatbot-input-container {
  padding: 0.85rem 1rem;
  background: #161c3c;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}

[data-theme="light"] .chatbot-input-container {
  background: #ffffff;
  border-top: 1px solid rgba(15, 20, 48, 0.1);
}

.chatbot-input-container input {
  flex: 1;
  background: #0d122b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 0.65rem 1rem;
  color: #ffffff;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

[data-theme="light"] .chatbot-input-container input {
  background: #f1f5f9;
  color: #0f1430;
  border: 1px solid rgba(15, 20, 48, 0.15);
}

.chatbot-input-container input:focus {
  border-color: #ffc829;
}

[data-theme="light"] .chatbot-input-container input:focus {
  border-color: #d97706;
  background: #ffffff;
}

.chatbot-input-container button {
  background: #ffc829;
  color: #0a0e23;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-size: 1.1rem;
}

.chatbot-input-container button:hover {
  background: #ffd75a;
  transform: scale(1.05);
}

/* Typing Dots */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.85rem 1.25rem;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: rgba(244, 244, 236, 0.5);
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out both;
}

[data-theme="light"] .typing-dots span {
  background: rgba(15, 20, 48, 0.4);
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating Trigger Button */
.floating-chat-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ffc829 0%, #e6a800 100%);
  color: #0a0e23;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 10px 30px rgba(255, 200, 41, 0.4);
  cursor: pointer;
  z-index: 99998;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: none;
  text-decoration: none;
}

.floating-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 40px rgba(255, 200, 41, 0.55);
}

@media (max-width: 480px) {
  .chatbot-window {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
}
