/**
 * FIXY Chatbot — Stylesheet
 * FIX Taxi Ludwigsburg
 */

/* ── FAB Button ──────────────────────────────────────────────────────────── */
#fixy-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

.fixy-fab-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #A76F43 0%, #C08A56 50%, #E6CC88 100%);
  box-shadow: 0 4px 20px rgba(167, 111, 67, 0.5), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #fff;
}

#fixy-fab:hover .fixy-fab-inner {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(139, 69, 19, 0.65), 0 3px 12px rgba(0,0,0,0.35);
}

#fixy-fab svg {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
}

.fixy-fab-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.fixy-fab-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.fixy-fab-pulse {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  animation: fixy-pulse 2s infinite;
}

@keyframes fixy-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
#fixy-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  justify-content: flex-end;
  align-items: flex-end;
  padding: 16px;
}

#fixy-overlay.open {
  display: flex;
  animation: fixy-overlay-in 0.2s ease-out;
}

@keyframes fixy-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 640px) {
  #fixy-overlay { align-items: flex-end; padding: 0; }
  #fixy-overlay.open { display: flex; }
}

/* ── Chat-Box ────────────────────────────────────────────────────────────── */
.fixy-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  height: 600px;
  max-height: calc(100vh - 32px);
  border-radius: 20px;
  background: #0f172a;
  border: 1px solid rgba(139, 69, 19, 0.3);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 4px 16px rgba(139,69,19,0.2);
  overflow: hidden;
  animation: fixy-box-in 0.25s ease-out;
}

@keyframes fixy-box-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .fixy-box {
    max-width: 100%;
    width: 100%;
    max-height: 92dvh;
    height: 92dvh;
    border-radius: 20px 20px 0 0;
  }
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.fixy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #A76F43 0%, #8C5A34 100%);
  border-bottom: 1px solid rgba(139, 69, 19, 0.3);
  flex-shrink: 0;
}

.fixy-header-info { display: flex; align-items: center; gap: 10px; }

.fixy-header-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.fixy-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FAF6EF;
  border: 1.5px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.fixy-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
}


 

/* ── Section-Spacing: 5px zwischen den Blöcken ──────────────────────────── */
.fixy-chat-actions { margin-bottom: 5px; }
.fix-cta { margin-bottom: 5px; }

/* ── Chat-Action-Buttons (pure icons, no frame) ─────────────────────────── */
.fixy-chat-actions {
  display: flex;
  gap: 4px;
  padding: 4px 12px 0;
  flex-shrink: 0;
  justify-content: flex-end;
  align-items: center;
}

#fixy-overlay .fixy-chat-action {
  all: unset;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  line-height: 0 !important;
  -webkit-tap-highlight-color: transparent !important;
}

#fixy-overlay .fixy-chat-action:hover { color: #334155 !important; background: transparent !important; }
#fixy-overlay .fixy-chat-action:focus,
#fixy-overlay .fixy-chat-action:focus-visible,
#fixy-overlay .fixy-chat-action:active { outline: none !important; background: transparent !important; }
#fixy-overlay .fixy-chat-action svg { width: 20px; height: 20px; display: block; }

#fixy-overlay .fixy-chat-wa { color: #25D366 !important; }
#fixy-overlay .fixy-chat-wa:hover { color: #34e17a !important; }
#fixy-overlay .fixy-chat-new { color: #94a3b8 !important; }
#fixy-overlay .fixy-chat-new:hover { color: #334155 !important; }
#fixy-overlay .fixy-chat-x { color: #94a3b8 !important; }
#fixy-overlay .fixy-chat-x:hover { color: #334155 !important; }

/* ── WhatsApp Sofort-CTA (unter dem Profil) ──────────────────────────────── */
.fix-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #E6CC88 0%, #d4b87a 100%);
  color: #1e293b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(230, 204, 136, 0.35);
  transition: filter 0.15s, transform 0.1s;
}
.fix-cta:hover { filter: brightness(1.06); background: linear-gradient(135deg, #d4a84a 0%, #c09840 100%); color: #fff; }
.fix-cta:active { transform: scale(0.99); }
.fix-cta svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Messages ────────────────────────────────────────────────────────────── */
.fixy-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,69,19,0.3) transparent;
  background: #ffffff;
}

.fixy-messages::-webkit-scrollbar { width: 4px; }
.fixy-messages::-webkit-scrollbar-thumb { background: rgba(139,69,19,0.3); border-radius: 2px; }
.fixy-messages::-webkit-scrollbar-track { background: transparent; }

/* ── Bubbles ─────────────────────────────────────────────────────────────── */
.fixy-bubble {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: fixy-bubble-in 0.15s ease-out;
}

@keyframes fixy-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fixy-bubble.fixy-carmen {
  align-self: flex-start;
  background: rgba(139, 69, 19, 0.15);
  border: 1px solid rgba(139, 69, 19, 0.3);
  border-radius: 14px 14px 14px 4px;
  color: #e2d9c8;
}

/* Carmen-Nachricht mit Profilbild-Avatar */
.fixy-row-carmen {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-start;
  max-width: 92%;
}
.fixy-row-carmen .fixy-bubble.fixy-carmen { max-width: 100%; }

.fixy-bubble.fixy-carmen {
  align-self: flex-start;
  background: rgba(139, 69, 19, 0.12);
  border: 1px solid rgba(139, 69, 19, 0.25);
  border-radius: 14px 14px 14px 4px;
  color: #4a3728;
}

.fixy-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(139, 69, 19, 0.3);
  background: #ffffff;
}

.fixy-bubble.fixy-guest {
  align-self: flex-end;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 14px 14px 4px 14px;
  color: #1e293b;
}

.fixy-bubble.fixy-error {
  align-self: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 12px;
  text-align: center;
  max-width: 90%;
}

/* ── Links in Bubbles ────────────────────────────────────────────────────── */
.fixy-bubble a,
.fixy-bubble a:visited {
  color: #06b6d4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fixy-bubble a:hover { color: #22d3ee; }

/* ── Typing Indicator ────────────────────────────────────────────────────── */
.fixy-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 8px;
}

.fixy-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(139, 69, 19, 0.6);
  animation: fixy-typing-dots 1.2s infinite;
}

.fixy-typing span:nth-child(2) { animation-delay: 0.15s; }
.fixy-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes fixy-typing-dots {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ── Input ────────────────────────────────────────────────────────────────── */
.fixy-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(139, 69, 19, 0.2);
  background: rgba(15, 23, 42, 0.8);
  flex-shrink: 0;
}

.fixy-form textarea {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(139, 69, 19, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  color: #f1f5f9;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.5;
}

.fixy-form textarea::placeholder { color: #64748b; }

.fixy-form textarea:focus {
  border-color: rgba(139, 69, 19, 0.6);
}

.fixy-form textarea:focus-visible { outline: 2px solid rgba(139,69,19,0.4); outline-offset: 1px; }

.fixy-send-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #A76F43, #8C5A34);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.fixy-send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(139, 69, 19, 0.45);
}

.fixy-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fixy-send-btn svg { width: 20px; height: 20px; }

/* ── Welcome Message ─────────────────────────────────────────────────────── */
.fixy-welcome {
  text-align: center;
  padding: 24px 20px;
  color: #94a3b8;
}

.fixy-welcome-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.fixy-welcome h3 {
  color: #e2d9c8;
  font-size: 16px;
  margin-bottom: 6px;
}

.fixy-welcome p {
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.fixy-welcome-tip {
  font-size: 12px;
  color: #25D366;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(37, 211, 102, 0.2);
  font-weight: 600;
}

/* ── Footer Hint ─────────────────────────────────────────────────────────── */
.fixy-footer {
  text-align: center;
  font-size: 10px;
  color: #475569;
  padding: 6px 0 8px;
  flex-shrink: 0;
}

.fixy-footer a { color: #64748b; }

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

/* ── Responsive Tweaks ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #fixy-fab { bottom: 16px; right: 16px; }
  .fixy-fab-inner { width: 56px; height: 56px; }
  .fixy-fab-label { font-size: 9px; }
}

/* ── WordPress Fullscreen Override ───────────────────────────────────────── */
body.fixy-no-scroll { overflow: hidden; position: fixed; width: 100%; }

/* ── Accessibility ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fixy-pulse, .fixy-typing-dots { animation: none; }
  .fixy-bubble { animation: none; }
  .fixy-box-in { animation: none; }
}