@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* =========================================================
   BizzyBot Chat Styles (optimized and unified)
   ========================================================= */
:root {
  --bizzy-header: #0ea5e9;
  --bizzy-user-color: #0ea5e9;
  --bizzy-bubble: #0ea5e9;
  --bizzy-inner: #f8fafc;
}

/* Root container */
.gbc-chat-root {
  position: fixed;
  right: 20px;
  z-index: 9999;
  font-family: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --transition: 0.25s ease;
}

/* Floating Button */
.gbc-fab {
  appearance: none;
  border: 0;
  outline: 0;
  cursor: pointer;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bizzy-bubble);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  position: fixed;
  bottom: 20px;
  right: 20px;
}
.gbc-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}
.gbc-fab.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Floating Icon */
.gbc-fab-icon {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  object-fit: contain;
}

/* Chat Panel */
.gbc-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 360px;
  max-height: 70vh;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}
.gbc-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.gbc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bizzy-header);
  color: #fff;
  height: 70px;
  padding: 15px 16px;
  box-sizing: border-box;
}
.gbc-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gbc-header-icon {
  height: 42px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
}
.gbc-title {
  font-family: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.gbc-close {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
}

/* Body */
.gbc-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  background: var(--bizzy-inner);
  font-size: 16px;
  line-height: 1.6;
}

/* Messages */
.gbc-msg {
  padding: 14px 18px;
  border-radius: 18px;
  margin: 14px 0;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 16px;
  line-height: 1.55;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.gbc-user {
  background: var(--bizzy-user-color);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 6px;
}
.gbc-bot {
  background: #eef2f7;
  color: #111827;
  margin-right: auto;
  border-bottom-left-radius: 6px;
}
.gbc-msg p {
  margin: 0;
  line-height: 1.55;
}

/* Message bubbles */
.gbc-msg {
  padding: 22px 20px;
  border-radius: 16px;
  margin: 12px 0;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 16px;
  line-height: 1.55;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.gbc-user {
  background: var(--bizzy-user-color);
  color: #fff;
  margin-left: auto;
}

.gbc-bot {
  background: #eef2f7;
  color: #111827;
  margin-right: auto;
}

/* Input Form */
.gbc-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.gbc-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  font-size: 15px;
  line-height: 1.4;
}
.gbc-send {
  width: 42px;
  border: 0;
  border-radius: 9999px;
  background: var(--bizzy-user-color);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.gbc-send:hover {
  opacity: 0.9;
}

/* Custom Icon for Send */
.gbc-send.has-image {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.gbc-send.has-image .gbc-send-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Typing Indicator */
.gbc-typing {
  display: flex;
  gap: 5px;
  margin: 10px 0 10px 8px;
}
.gbc-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  animation: gbc-bounce 1.2s infinite ease-in-out;
}
.gbc-typing span:nth-child(2) { animation-delay: 0.15s; }
.gbc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes gbc-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
  40% { transform: scale(1); opacity: 1; }
}

/* Follow-up form */
.gbc-followup-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px;
  box-sizing: border-box;
}

.gbc-followup-text {
  margin: 0 0 10px;
  font-size: 15px;
  color: #374151;
  line-height: 1.4;
}

.gbc-followup-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
}

.gbc-followup-button {
  background: var(--bizzy-user-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.gbc-followup-button:hover {
  opacity: 0.9;
}

.gbc-followup-form p {
  margin: 0 0 10px;
  font-size: 15px;
  color: #374151;
  line-height: 1.4;
}
.gbc-followup-form input[type="text"],
.gbc-followup-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
}
.gbc-followup-form button {
  background: var(--bizzy-user-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s ease;
  box-sizing: border-box;
}
.gbc-followup-form button:hover {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 480px) {
  .gbc-panel {
    width: 90vw;
    bottom: 80px;
  }
}

.gbc-bot a {
  color: var(--bizzy-user-color);
  text-decoration: underline;
  word-break: break-word;
}

.gbc-bot ul, .gbc-bot ol {
  margin: 6px 0 6px 1.2em;
  padding: 0;
}

.gbc-bot code {
  font-family: monospace;
  background: #f3f4f6;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 90%;
}

@keyframes gbc-wiggle {
  0% { transform: translateY(0) rotate(0); }
  15% { transform: translateY(-2px) rotate(-6deg); }
  30% { transform: translateY(0) rotate(5deg); }
  45% { transform: translateY(-1px) rotate(-4deg); }
  60% { transform: translateY(0) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}
.gbc-fab.attention {
  animation: gbc-wiggle 0.6s ease both;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
@media (prefers-reduced-motion: reduce) {
  .gbc-fab.attention { animation: none; }
}
