/* ══════════════════════════════════════════
   CHAT WIDGET — Blue Hero Edition
   ══════════════════════════════════════════ */

/* ── Toggle-Button ── */
.chat-toggle {
  position: fixed; bottom: 8.25rem; right: 2rem; z-index: 1000;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #e5007d 0%, #a8005c 100%);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(229,0,125,0.45);
  transition: transform .2s, box-shadow .2s;
}
.chat-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 32px rgba(229,0,125,0.65); }
.chat-toggle svg { color: #fff; }
.chat-toggle .icon-close { display: none; }
.chat-toggle.open .icon-chat  { display: none; }
.chat-toggle.open .icon-close { display: block; }

/* ── Chat-Fenster ── */
.chat-window {
  position: fixed; bottom: 11.75rem; right: 2rem; z-index: 999;
  width: 360px; max-height: 520px;
  background: #080e1c;
  border: 1px solid rgba(0,172,233,0.18);
  border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,10,40,0.75), 0 0 0 1px rgba(0,172,233,0.06);
  transform: scale(0.92) translateY(10px); opacity: 0;
  pointer-events: none; transition: transform .25s ease, opacity .25s ease;
  transform-origin: bottom right;
  overflow: hidden;
}
.chat-window::before {
  content: ''; pointer-events: none;
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,172,233,0.08) 0%, transparent 70%);
  z-index: 0;
}
.chat-window.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

/* ── Header ── */
.chat-header {
  position: relative; z-index: 1;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0,172,233,0.12);
  display: flex; align-items: center; gap: 0.75rem;
  background: linear-gradient(135deg, #00ace9 0%, #1d4d98 100%);
  border-radius: 16px 16px 0 0; flex-shrink: 0;
}
.chat-avatar {
  position: relative; flex-shrink: 0;
  width: 38px; height: 38px;
}
.chat-avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 2px solid rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: #fff; letter-spacing: 0.04em;
  font-family: inherit;
}
.chat-avatar-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #e5007d; border: 2px solid #1d4d98;
  animation: chat-pulse 2s ease infinite;
}
@keyframes chat-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.chat-header-info strong { display: block; font-size: 0.88rem; font-weight: 700; color: #fff; }
.chat-header-info span   { font-size: 0.75rem; color: rgba(255,255,255,0.65); }

/* ── Nachrichten ── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  position: relative; z-index: 1;
  scrollbar-width: thin; scrollbar-color: rgba(0,172,233,0.15) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,172,233,0.2); border-radius: 2px; }

.msg {
  max-width: 86%; font-size: 0.855rem; line-height: 1.5;
  padding: 0.6rem 0.9rem; border-radius: 12px; word-break: break-word;
}
.msg-bot  { background: #0d1628; color: #e8ecf4; border: 1px solid rgba(0,172,233,0.1); border-bottom-left-radius: 3px; align-self: flex-start; }
.msg-user { background: linear-gradient(135deg, #00ace9, #1d4d98); color: #fff; border-bottom-right-radius: 3px; align-self: flex-end; }
.msg-note { font-size: 0.76rem; color: rgba(0,172,233,0.6); background: rgba(0,172,233,0.05); border: 1px solid rgba(0,172,233,0.1); align-self: flex-start; }

/* ── Typing-Indikator ── */
.msg-typing { display: flex; gap: 5px; align-items: center; padding: 0.75rem 0.9rem; }
.msg-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(0,172,233,0.5);
  animation: chat-typing .9s ease infinite;
}
.msg-typing span:nth-child(2) { animation-delay: .15s; }
.msg-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes chat-typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* ── Input-Bereich ── */
.chat-input-row {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0,172,233,0.1);
  background: rgba(0,5,15,0.4);
  display: flex; gap: 0.5rem; align-items: flex-end; flex-shrink: 0;
  position: relative; z-index: 1;
}
.chat-input {
  flex: 1; background: rgba(0,172,233,0.06); border: 1px solid rgba(0,172,233,0.2);
  border-radius: 8px; padding: 0.55rem 0.8rem; color: #e8ecf4;
  font-size: 0.85rem; font-family: inherit; resize: none; outline: none;
  transition: border-color .2s; max-height: 100px; line-height: 1.45; overflow-y: auto;
}
.chat-input:focus { border-color: rgba(0,172,233,0.55); }
.chat-input::placeholder { color: rgba(255,255,255,0.25); }
.chat-input:disabled { opacity: 0.5; }

.chat-send {
  width: 36px; height: 36px; border-radius: 8px; border: none; cursor: pointer; flex-shrink: 0;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s, transform .15s;
}
.chat-send:hover:not(:disabled) { opacity: 0.85; transform: scale(1.06); }
.chat-send:disabled { opacity: 0.35; cursor: not-allowed; }
.chat-send svg { color: #e5007d; }

/* ── Neue Anfrage ── */
.chat-new-inquiry { text-align: center; margin-top: 0.5rem; }
.chat-new-inquiry-btn {
  background: transparent; border: 1px solid rgba(0,172,233,0.35);
  color: #00ace9; font-size: 0.8rem; font-weight: 600;
  padding: 0.5rem 1.2rem; border-radius: 999px; cursor: pointer;
  transition: background .2s, color .2s;
}
.chat-new-inquiry-btn:hover { background: rgba(0,172,233,0.1); color: #33bef0; }

/* ── Footer ── */
.chat-footer {
  padding: 0.45rem 1rem; text-align: center;
  font-size: 0.68rem; color: rgba(255,255,255,0.15);
  border-top: 1px solid rgba(0,172,233,0.07);
  background: rgba(0,5,15,0.4);
  position: relative; z-index: 1;
}

/* ── Consent-Screen ── */
.chat-consent {
  flex: 1; overflow-y: auto;
  padding: 1.5rem 1.25rem 1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.75rem;
  position: relative; z-index: 1;
}
.chat-consent-icon { font-size: 1.8rem; line-height: 1; }
.chat-consent-title { font-size: 0.95rem; font-weight: 600; color: #fff; margin: 0; }
.chat-consent-text {
  font-size: 0.78rem; color: rgba(255,255,255,0.5); line-height: 1.6; margin: 0;
}
.chat-consent-text a { color: #00ace9; text-decoration: none; display: inline-block; }
.chat-consent-text a:hover { text-decoration: underline; }
.chat-consent-btn {
  margin-top: 0.5rem; width: 100%;
  padding: 0.65rem 1rem; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, #e5007d, #a8005c);
  color: #fff; font-size: 0.85rem; font-weight: 600; transition: opacity .2s;
}
.chat-consent-btn:hover { opacity: 0.88; }
.chat-consent-decline {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.3); font-size: 0.75rem;
  padding: 0.25rem; transition: color .2s;
}
.chat-consent-decline:hover { color: rgba(255,255,255,0.6); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .chat-window  { left: 0.75rem; right: 0.75rem; width: auto; bottom: 10.5rem; }
  .chat-toggle  { right: 1rem; bottom: 7rem; }
  .chat-input   { font-size: 1rem; } /* iOS: verhindert Auto-Zoom bei focus (< 16px triggert Zoom) */
}
