/* =============================================
   REIFEN CHRIS — chatbot.css
   Floating chat widget, passt zum Dark-Theme
   ============================================= */

/* ---- WRAPPER ---- */
#rc-chat-wrapper {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

/* ---- TOGGLE BUTTON ---- */
.rc-toggle {
  position: relative;
  width: auto;
  height: auto;
  border-radius: 50px;
  background: #d42b23;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  box-shadow: 0 4px 24px rgba(212, 43, 35, 0.6);
  cursor: pointer;
  border: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
  z-index: 10;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: rcPulseBtn 3s ease infinite;
}
.rc-toggle::after {
  content: 'Fragen? Ich helfe!';
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.rc-toggle:hover {
  transform: scale(1.1);
  background: #b02020;
}
.rc-toggle:active { transform: scale(0.97); }

.rc-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
}

/* Unread badge */
.rc-unread {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #f59e0b;
  color: #000;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid #0a0a0a;
  animation: rcBounce 1.5s ease infinite;
}

@keyframes rcBounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}
@keyframes rcPulseBtn {
  0%, 100% { box-shadow: 0 4px 24px rgba(212,43,35,0.6); }
  50%       { box-shadow: 0 4px 36px rgba(212,43,35,0.9), 0 0 0 8px rgba(212,43,35,0.15); }
}

/* ---- CHAT WINDOW ---- */
.rc-window {
  position: absolute;
  top: 72px;
  right: 0;
  width: 360px;
  max-height: 560px;
  background: #111111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,43,35,0.15);

  /* Hidden by default */
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  transform-origin: bottom right;
}
.rc-window--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ---- HEADER ---- */
.rc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #0f0f0f;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}
.rc-header-info { display: flex; align-items: center; gap: 0.75rem; }

.rc-avatar {
  width: 38px;
  height: 38px;
  background: #d42b23;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.rc-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f4f2ee;
  line-height: 1.2;
}
.rc-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: #666;
  margin-top: 2px;
}
.rc-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  animation: rcPulse 2s ease infinite;
}
@keyframes rcPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.rc-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #555;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.rc-close-btn:hover { color: #f4f2ee; background: #1e1e1e; }

/* ---- MESSAGES ---- */
.rc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.rc-messages::-webkit-scrollbar { width: 4px; }
.rc-messages::-webkit-scrollbar-track { background: transparent; }
.rc-messages::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

/* ---- MESSAGE BUBBLES ---- */
.rc-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
.rc-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}
.rc-msg--bot {
  align-self: flex-start;
  align-items: flex-start;
}

.rc-bubble {
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.rc-msg--user .rc-bubble {
  background: #d42b23;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.rc-msg--bot .rc-bubble {
  background: #1a1a1a;
  color: #e0ddd8;
  border: 1px solid #252525;
  border-bottom-left-radius: 4px;
}

.rc-time {
  font-size: 0.65rem;
  color: #444;
  margin-top: 3px;
  padding: 0 4px;
}

/* Animate new messages */
.rc-msg--new {
  animation: rcMsgIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}
@keyframes rcMsgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- TYPING INDICATOR ---- */
.rc-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.8rem 1rem;
}
.rc-typing span {
  width: 7px;
  height: 7px;
  background: #555;
  border-radius: 50%;
  animation: rcTypeDot 1.2s ease infinite;
}
.rc-typing span:nth-child(2) { animation-delay: 0.2s; }
.rc-typing span:nth-child(3) { animation-delay: 0.4s; }

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

/* ---- QUICK REPLIES ---- */
.rc-quick-wrap {
  padding: 0.5rem 0.75rem 0.25rem;
  border-top: 1px solid #1a1a1a;
  flex-shrink: 0;
}
.rc-quick-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.4rem;
}
.rc-quick-scroll::-webkit-scrollbar { display: none; }

.rc-quick-btn {
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #aaa;
  font-size: 0.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.rc-quick-btn:hover {
  border-color: #d42b23;
  color: #f4f2ee;
  background: rgba(212,43,35,0.08);
}

/* ---- INPUT AREA ---- */
.rc-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #1a1a1a;
  background: #0f0f0f;
  flex-shrink: 0;
}

.rc-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #f4f2ee;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.6rem 0.875rem;
  resize: none;
  outline: none;
  max-height: 100px;
  line-height: 1.5;
  transition: border-color 0.2s;
}
.rc-input:focus { border-color: #d42b23; }
.rc-input::placeholder { color: #444; }

.rc-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: #d42b23;
  color: #fff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}
.rc-send:disabled { opacity: 0.35; cursor: default; }
.rc-send:not(:disabled):hover { background: #b02020; transform: scale(1.05); }

/* ---- MOBILE ---- */
@media (max-width: 480px) {
  #rc-chat-wrapper { bottom: 1rem; right: 1rem; }
  .rc-window {
    width: calc(100vw - 2rem);
    max-height: 75vh;
    bottom: 66px;
  }
}
