/* GlobeX Chatbot Plugin — chatbot.css */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --gcx-bg:      #0d0f0e;
  --gcx-surface: #161a18;
  --gcx-card:    #1e2420;
  --gcx-border:  #2a3330;
  --gcx-accent:  #c8a96e;
  --gcx-green:   #4caf7d;
  --gcx-text:    #e8ede9;
  --gcx-muted:   #7a8c80;
  --gcx-user:    #1f3028;
  --gcx-bot:     #1a2420;
}

/* ── LAUNCHER ─────────────────────────────────────────── */
#globex-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, #c8a96e, #a07840);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(200,169,110,0.45), 0 2px 10px rgba(0,0,0,0.4);
  z-index: 999999;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
  border: none;
  outline: none;
}
#globex-launcher:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(200,169,110,0.6);
}
#globex-launcher:active { transform: scale(0.95); }

.globex-launcher-icon,
.globex-launcher-close {
  position: absolute;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
}
.globex-launcher-icon  { font-size: 26px; }
.globex-launcher-close { font-size: 22px; color: white; opacity: 0; transform: rotate(-90deg) scale(0.5); }

#globex-launcher.gcx-open .globex-launcher-icon  { opacity: 0; transform: rotate(90deg) scale(0.5); }
#globex-launcher.gcx-open .globex-launcher-close { opacity: 1; transform: rotate(0deg) scale(1); }

.globex-unread-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 18px; height: 18px;
  background: #e05252;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  border: 2px solid white;
  animation: gcxBadgePop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes gcxBadgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── CHAT WINDOW ──────────────────────────────────────── */
#globex-chat-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 370px;
  height: 560px;
  background: var(--gcx-surface);
  border-radius: 22px;
  border: 1px solid var(--gcx-border);
  box-shadow: 0 24px 70px rgba(0,0,0,0.65), 0 0 0 1px rgba(200,169,110,0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999998;
  transform: scale(0.85) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;
  font-family: 'DM Sans', sans-serif;
}
#globex-chat-window.gcx-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 480px) {
  #globex-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 96px;
    height: calc(100vh - 120px);
    max-height: 580px;
    border-radius: 18px;
  }
  #globex-launcher { bottom: 20px; right: 16px; }
}

/* ── HEADER ───────────────────────────────────────────── */
.globex-header {
  background: var(--gcx-card);
  border-bottom: 1px solid var(--gcx-border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.globex-header-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gcx-accent), #a07840);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(200,169,110,0.3);
}
.globex-header-info { flex: 1; min-width: 0; }
.globex-header-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gcx-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.globex-header-status {
  font-size: 11px;
  color: var(--gcx-green);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.globex-status-dot {
  width: 6px; height: 6px;
  background: var(--gcx-green);
  border-radius: 50%;
  animation: gcxPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes gcxPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
.globex-wa-btn {
  background: #25D366;
  border: none;
  color: white;
  padding: 6px 11px;
  border-radius: 16px;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  text-decoration: none;
  flex-shrink: 0;
}
.globex-wa-btn:hover { background: #1ebe59; transform: scale(1.04); color: white; }

/* ── MESSAGES ─────────────────────────────────────────── */
.globex-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.globex-messages::-webkit-scrollbar { width: 3px; }
.globex-messages::-webkit-scrollbar-thumb { background: var(--gcx-border); border-radius: 2px; }

.gcx-msg {
  display: flex;
  gap: 8px;
  animation: gcxFadeIn 0.3s ease;
}
@keyframes gcxFadeIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gcx-msg.gcx-user { flex-direction: row-reverse; }

.gcx-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}
.gcx-bot .gcx-msg-avatar  { background: linear-gradient(135deg, var(--gcx-accent), #a07840); }
.gcx-user .gcx-msg-avatar { background: var(--gcx-user); border: 1px solid var(--gcx-border); }

.gcx-msg-body { max-width: 82%; }

.gcx-msg-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
  color: var(--gcx-text);
}
.gcx-bot .gcx-msg-bubble  { background: var(--gcx-bot);  border: 1px solid var(--gcx-border); border-top-left-radius: 3px; }
.gcx-user .gcx-msg-bubble { background: var(--gcx-user); border: 1px solid rgba(76,175,125,0.2); border-top-right-radius: 3px; text-align: right; }

.gcx-msg-time { font-size: 9px; color: var(--gcx-muted); margin-top: 3px; padding: 0 3px; }
.gcx-user .gcx-msg-time { text-align: right; }

/* ── QUICK REPLIES ────────────────────────────────────── */
.gcx-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gcx-qr-btn {
  background: transparent;
  border: 1px solid var(--gcx-accent);
  color: var(--gcx-accent);
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.gcx-qr-btn:hover { background: var(--gcx-accent); color: #0d0f0e; }

/* ── TYPING ───────────────────────────────────────────── */
.gcx-typing { display: flex; gap: 8px; align-items: flex-end; }
.gcx-typing-dots {
  background: var(--gcx-bot);
  border: 1px solid var(--gcx-border);
  border-radius: 14px;
  border-bottom-left-radius: 3px;
  padding: 12px 14px;
  display: flex; gap: 4px; align-items: center;
}
.gcx-typing-dots span {
  width: 6px; height: 6px;
  background: var(--gcx-muted);
  border-radius: 50%;
  animation: gcxTyping 1.2s infinite;
}
.gcx-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.gcx-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gcxTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── INPUT ────────────────────────────────────────────── */
.globex-input-area {
  background: var(--gcx-card);
  border-top: 1px solid var(--gcx-border);
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.globex-input-wrap {
  flex: 1;
  background: var(--gcx-bg);
  border: 1px solid var(--gcx-border);
  border-radius: 14px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s;
}
.globex-input-wrap:focus-within { border-color: var(--gcx-accent); }
#globexInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--gcx-text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  resize: none;
  max-height: 70px;
  line-height: 1.5;
}
#globexInput::placeholder { color: var(--gcx-muted); }

.globex-send-btn {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gcx-accent), #a07840);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(200,169,110,0.25);
}
.globex-send-btn:hover  { transform: scale(1.06); box-shadow: 0 5px 16px rgba(200,169,110,0.4); }
.globex-send-btn:active { transform: scale(0.96); }

/* ── PRODUCT CARD ─────────────────────────────────────── */
.gcx-product-card {
  background: var(--gcx-card);
  border: 1px solid var(--gcx-border);
  border-radius: 10px;
  padding: 11px;
  margin-top: 7px;
}
.gcx-product-card h4 {
  color: var(--gcx-accent);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 7px;
  font-family: 'Playfair Display', serif;
}
.gcx-product-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gcx-muted);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.gcx-product-row:last-child { border-bottom: none; }
.gcx-product-row span:last-child { color: var(--gcx-text); font-weight: 500; text-align: right; max-width: 55%; }
