/* palace-chat-widget.css — style widgetu chatbota Ducha Pałacu */
/* Zgodne z motywem aqua/navy portalu DPPALACE. Bez inline style. */

.chat-fab {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.chat-fab.hide { opacity: 0; pointer-events: none; transform: translateY(20px); }
.chat-fab-icon { font-size: 1.1rem; line-height: 1; }

.chat-panel {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  width: min(420px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 3rem));
  z-index: 10000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(122, 74, 58, 0.12);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  background: var(--gradient-primary);
  color: #fff;
}
.chat-title { margin: 0; font-family: var(--font-heading); font-weight: 800; font-size: 1rem; }
.chat-subtitle { margin: 0.1rem 0 0; font-size: 0.78rem; opacity: 0.85; }
.chat-close {
  background: transparent; border: none; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 0.4rem;
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem;
  background: rgba(236, 247, 251, 0.45);
}
.chat-msg-user { display: flex; justify-content: flex-end; }
.chat-msg-bot { display: flex; justify-content: flex-start; }
.chat-bubble {
  padding: 0.6rem 0.85rem; border-radius: var(--radius-md); font-size: 0.92rem; line-height: 1.5;
  max-width: 86%; word-wrap: break-word;
}
.chat-msg-user .chat-bubble { background: var(--gradient-primary); color: #fff; }
.chat-msg-bot .chat-bubble { background: rgba(255,255,255,0.95); color: var(--color-text-main); border: 1px solid rgba(122, 74, 58, 0.08); }
.chat-bubble a { color: var(--color-accent-cyan); }

.chat-loading-bubble { display: flex; gap: 0.3rem; }
.chat-loading-bubble span {
  width: 18px; height: 8px; background: rgba(196, 122, 110, 0.4); border-radius: 4px;
  animation: chat-loading 1.2s ease-in-out infinite;
}
.chat-loading-bubble span:nth-child(2) { animation-delay: 0.2s; }
.chat-loading-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-loading { 0%,100% { opacity: 0.2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.chat-input-row {
  display: flex; gap: 0.4rem; padding: 0.7rem; border-top: 1px solid rgba(122, 74, 58, 0.08); background: rgba(255,255,255,0.95);
}
.chat-input {
  flex: 1; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid rgba(122, 74, 58, 0.25); font-family: var(--font-body); font-size: 0.92rem;
}
.chat-send { padding: 0.5rem 0.8rem; border-radius: var(--radius-sm); border: none; background: var(--color-accent-cyan); color: #fff; font-weight: 700; cursor: pointer; }
.chat-send:disabled { opacity: 0.5; }

.chat-disclaimer { padding: 0.5rem 0.9rem 0.7rem; margin: 0; font-size: 0.7rem; color: var(--color-text-muted); text-align: center; background: rgba(255,255,255,0.95); }

@media (max-width: 600px) {
  .chat-panel { bottom: 0; right: 0; width: 100vw; height: 100vh; border-radius: 0; }
  .chat-fab { bottom: 1rem; right: 1rem; }
}
