/* ── EuroFlexx24 Chat Widget — ChatGPT-inspired Design ──────────────────── */
/* Palette: #212121 (bg) · #2f2f2f (surface) · #3a3a3a (border) · #ececec (text) */

#ef24-chat-root *,
#ef24-chat-root *::before,
#ef24-chat-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Launcher Button ─────────────────────────────────────────────────────── */
#ef24-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fc9f59, #fe6603);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(252, 159, 89, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#ef24-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(252, 159, 89, 0.55);
}

#ef24-launcher svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  transition: opacity 0.2s ease;
}

#ef24-launcher .ef24-icon-close { display: none; }
#ef24-launcher.open .ef24-icon-chat  { display: none; }
#ef24-launcher.open .ef24-icon-close { display: block; }

/* ── Chat Container ──────────────────────────────────────────────────────── */
#ef24-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #212121;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#ef24-chat-window.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
#ef24-header {
  background: #212121;
  border-bottom: 1px solid #3a3a3a;
  padding: 16px 20px;
  flex-shrink: 0;
}

#ef24-header-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #ececec;
}

/* ── Consent Banner ──────────────────────────────────────────────────────── */
#ef24-consent {
  background: #212121;
  border-bottom: 1px solid #3a3a3a;
  padding: 18px 20px;
  flex-shrink: 0;
}

.ef24-consent-text {
  font-size: 18px;
  color: #ececec;
  line-height: 1.8;
  margin-bottom: 20px;
}

.ef24-consent-text strong {
  color: #fff;
}

#ef24-consent-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
}

/* Spezifität höher als #ef24-chat-root * { padding:0 } */
#ef24-chat-root .ef24-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

#ef24-chat-root .ef24-btn:hover  { opacity: 0.85; }
#ef24-chat-root .ef24-btn:active { opacity: 0.7; }

#ef24-chat-root .ef24-btn-primary {
  background: #ececec;
  color: #212121;
}

#ef24-chat-root .ef24-btn-ghost {
  background: transparent;
  color: #c8c8c8;
  border: 1px solid #3a3a3a;
}

#ef24-chat-root .ef24-btn-ghost:hover { color: #ececec; border-color: #555; background: #2f2f2f; }

/* ── Messages ────────────────────────────────────────────────────────────── */
#ef24-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

#ef24-messages::-webkit-scrollbar       { width: 4px; }
#ef24-messages::-webkit-scrollbar-track { background: transparent; }
#ef24-messages::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }

.ef24-msg {
  display: flex;
  max-width: 100%;
  animation: ef24-fadein 0.18s ease;
}

@keyframes ef24-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* User messages: right-aligned, subtle rounded background */
.ef24-msg.user {
  justify-content: flex-end;
  margin-bottom: 6px;
}

/* Bot messages: left-aligned, no background */
.ef24-msg.bot {
  justify-content: flex-start;
  margin-bottom: 6px;
}

.ef24-msg.system {
  justify-content: center;
}

/* Shared bubble base */
.ef24-bubble {
  background: transparent;
  color: #ececec;
  padding: 6px 0;
  max-width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(16px, 1.1vw, 18px);
  line-height: 1.7;
  word-break: break-word;
}

.ef24-msg.system .ef24-bubble {
  background: transparent;
  color: #555;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  text-align: center;
  padding: 4px 8px;
}

/* Paragraphs and lists inside bot replies */
.ef24-bubble p + p { margin-top: 8px; }

.ef24-bubble ul,
.ef24-bubble ol {
  padding-left: 20px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Typing Indicator ────────────────────────────────────────────────────── */
.ef24-typing .ef24-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 16px 0;
}

.ef24-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  animation: ef24-bounce 1.2s infinite ease-in-out;
}

.ef24-dot:nth-child(2) { animation-delay: 0.2s; }
.ef24-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ef24-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* ── Handoff Buttons ─────────────────────────────────────────────────────── */
.ef24-handoff-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.ef24-handoff-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #ececec;
  padding: 9px 14px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: fit-content;
}

.ef24-handoff-btn:hover {
  background: #2f2f2f;
  border-color: #555;
}

.ef24-handoff-btn svg {
  width: 13px;
  height: 13px;
  fill: #8e8ea0;
  flex-shrink: 0;
}

/* ── Input Area ──────────────────────────────────────────────────────────── */
#ef24-input-area {
  border-top: 1px solid #3a3a3a;
  padding: 12px 16px 14px;
  background: #212121;
  flex-shrink: 0;
}

/* Das gerundete Pod — wie ChatGPT */
#ef24-input-pod {
  position: relative;
  background: #2f2f2f;
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  transition: border-color 0.15s ease;
}

#ef24-input-pod:focus-within {
  border-color: #555;
}

#ef24-input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 20px;
  padding: 14px 56px 14px 18px;
  color: #ececec;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(16px, 1.1vw, 18px);
  line-height: 1.6;
  resize: none;
  min-height: 56px;
  max-height: 160px;
  outline: none;
  overflow-y: auto;
}

#ef24-input::placeholder { color: #555; }

/* Kreisrunder Send-Button mit Pfeil nach oben */
#ef24-send-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ececec;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

#ef24-send-btn:hover:not(:disabled) {
  background: #fff;
  transform: scale(1.06);
}

#ef24-send-btn:active { transform: scale(0.96); }

#ef24-send-btn:disabled {
  background: #3a3a3a;
  cursor: not-allowed;
}

#ef24-send-btn svg {
  width: 16px;
  height: 16px;
  fill: #212121;
}

#ef24-send-btn:disabled svg {
  fill: #666;
}

/* Toolbar unterhalb des Pods */
#ef24-input-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 4px 0;
}

#ef24-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #9a9a9a;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#ef24-contact-btn:hover {
  background: #2f2f2f;
  border-color: #555;
  color: #ececec;
}

#ef24-contact-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Privacy Note ────────────────────────────────────────────────────────── */
#ef24-footer {
  padding: 6px 16px 10px;
  text-align: center;
  background: #212121;
  flex-shrink: 0;
}

#ef24-footer span {
  font-size: 11px;
  color: #404040;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #ef24-chat-window {
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }

  #ef24-launcher {
    bottom: 16px;
    right: 16px;
  }

  .ef24-bubble,
  #ef24-input,
  #ef24-input::placeholder {
    font-size: 16px;
  }
}
