/* ── CHAT WIDGET ── */

/* Nudge the floating "Plan a Party" button up so chat button fits below */
.float-btn { bottom: 5.5rem; }

.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
}

.chat-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,0,0,0.34);
}
.chat-icon-open  { display: block; }
.chat-icon-close { display: none; }
.chat-widget.is-open .chat-icon-open  { display: none; }
.chat-widget.is-open .chat-icon-close { display: block; }

.chat-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 320px;
  max-height: 460px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.94) translateY(10px);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.2s;
}
.chat-widget.is-open .chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.chat-panel-header {
  background: var(--blue);
  color: white;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.chat-panel-avatar {
  font-size: 1.3rem;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-panel-info { flex: 1; min-width: 0; }
.chat-panel-title { font-weight: 800; font-size: 0.92rem; }
.chat-panel-subtitle { font-size: 0.72rem; opacity: 0.82; }
.chat-panel-close {
  background: none;
  border: none;
  color: white;
  opacity: 0.75;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}
.chat-panel-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.chat-msg { display: flex; }
.chat-msg--bot  { justify-content: flex-start; }
.chat-msg--user { justify-content: flex-end; }

.chat-bubble {
  max-width: 88%;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  font-family: 'Nunito', sans-serif;
  word-break: break-word;
}
.chat-msg--bot  .chat-bubble { background: #f1f3f5; color: var(--dark); border-bottom-left-radius: 4px; }
.chat-msg--user .chat-bubble { background: var(--blue); color: white; border-bottom-right-radius: 4px; }
.chat-bubble p  { margin: 0 0 0.35rem; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul { margin: 0.25rem 0 0.35rem 1.1rem; padding: 0; }
.chat-bubble li { margin-bottom: 0.15rem; }

.chat-msg--typing .chat-bubble {
  background: #f1f3f5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.65rem 0.85rem;
}
.typing-dot {
  width: 7px;
  height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  padding: 0.48rem 0.85rem;
  font-size: 0.86rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.chat-input:focus { border-color: var(--blue); }

.chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.chat-send:hover:not(:disabled) { background: #b51d13; transform: scale(1.08); }
.chat-send:disabled { background: #ccc; cursor: default; }

@media (max-width: 640px) {
  .chat-panel { width: calc(100vw - 2rem); right: -0.5rem; }
  .float-btn  { bottom: 5.5rem; }
}
