/* Chat Widget Styles */
.gb-chat-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  background: #f59e0b;
  color: #111827;
  border-radius: 9999px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  /* Heartbeat (bums-bums) animation */
  animation: gb-heartbeat 1.6s ease-in-out infinite;
  will-change: transform, box-shadow;
}
.gb-chat-bubble .gb-chat-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  /* Sync the dot with a subtle beat */
  animation: gb-dot-beat 1.6s ease-in-out infinite;
  will-change: transform, opacity;
}

.gb-chat-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
}

.gb-chat-modal {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 360px;
  max-height: 70vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 10000;
  display: none;
  overflow: hidden;
}
.gb-chat-header {
  background: #111827;
  color: #f9fafb;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gb-chat-header .gb-chat-title {
  font-weight: 700;
}
.gb-chat-close {
  cursor: pointer;
  color: #f9fafb;
}
.gb-chat-body {
  padding: 10px 12px;
  height: 320px;
  overflow-y: auto;
  background: #f3f4f6;
}
.gb-chat-footer {
  border-top: 1px solid #e5e7eb;
  padding: 10px;
  background: #fff;
}
.gb-chat-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
}
.gb-chat-send {
  margin-top: 8px;
  width: 100%;
  background: #f59e0b;
  color: #111827;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

.gb-msg {
  max-width: 80%;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.3;
}
.gb-msg.user { 
  margin-left: auto; 
  background: #fde68a; 
  color: #111827; 
}
.gb-msg.admin { 
  margin-right: auto; 
  background: #fff; 
  color: #111827; 
  border: 1px solid #e5e7eb; 
}
.gb-msg.system { 
  margin: 8px auto; 
  background: transparent; 
  color: #6b7280; 
  font-style: italic; 
}

.gb-chat-faq {
  margin-top: 8px;
}
.gb-chat-faq h4 {
  margin: 6px 0;
  font-size: 0.95rem;
}
.gb-chat-faq-item { 
  background: #fff; 
  border: 1px solid #e5e7eb; 
  border-radius: 8px; 
  padding: 8px; 
  margin-bottom: 6px; 
}
.gb-chat-faq-item .q {
  font-weight: 600;
}
.gb-chat-faq-item .a {
  color: #374151;
}

@media (max-width: 480px) {
  .gb-chat-modal { right: 10px; bottom: 70px; width: 92vw; }
}

/* ===== Animations ===== */
@keyframes gb-heartbeat {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  }
  15% {
    transform: scale(1.06);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  }
  30% {
    transform: scale(1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  }
  45% {
    transform: scale(1.06);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  }
  60% {
    transform: scale(1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  }
}

@keyframes gb-dot-beat {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  15% {
    transform: scale(1.25);
    opacity: 0.9;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(1.25);
    opacity: 0.9;
  }
  60% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Pause the animation when user interacts */
.gb-chat-bubble:hover {
  animation-play-state: paused;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .gb-chat-bubble { animation: none; }
  .gb-chat-bubble .gb-chat-dot { animation: none; }
}

/* Pre-chat form styling */
.gb-prechat {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}
.gb-prechat h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.gb-prechat .row {
  display: flex;
  gap: 8px;
}
.gb-prechat .input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
}
.gb-prechat .actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.gb-prechat .error {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 0.9rem;
}