/* ────────────────────────────────────────────────────────
   PARROVENUE CATBOT STYLING
   Glassmorphic clean design with ParroVenue Emerald theme
   Powered by Phins IQ
   ──────────────────────────────────────────────────────── */

:root {
  --cb-bg-glass: rgba(255, 255, 255, 0.98);
  --cb-border-glass: rgba(0, 0, 0, 0.08);
  --cb-brand-emerald: #059669;
  --cb-brand-teal: #0d9488;
  --cb-brand-cyan: #0284c7;
  --cb-gradient-accent: linear-gradient(135deg, #059669, #0284c7);
  --cb-text-primary: #0f172a;
  --cb-text-secondary: #64748b;
  --cb-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

body.loading #catbot-root { display: none !important; }

/* ── TRIGGER BUTTON ── */
.catbot-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--cb-border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483645 !important;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.25);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

.catbot-trigger::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  border: 2px solid var(--cb-brand-emerald);
  opacity: 0.6;
  animation: catbot-pulse 2s infinite;
  pointer-events: none;
}

.catbot-trigger::after {
  content: '×';
  position: absolute;
  font-size: 32px;
  font-weight: 300;
  color: #0f172a;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  line-height: 1;
}

.catbot-trigger:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 30px rgba(5, 150, 105, 0.4);
}

.catbot-trigger.active {
  background: #ffffff;
  border: 1px solid var(--cb-border-glass);
  box-shadow: var(--cb-shadow);
}

.catbot-trigger.active .catbot-logo-img { opacity: 0; transform: scale(0.5); }
.catbot-trigger.active::after { opacity: 1; transform: scale(1); }

.catbot-trigger .catbot-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes catbot-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* ── CHAT CONTAINER ── */
.catbot-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: var(--cb-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cb-border-glass);
  border-radius: 20px;
  box-shadow: var(--cb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483644 !important;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.catbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── HEADER ── */
.catbot-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--cb-border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catbot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.catbot-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid var(--cb-brand-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
}

.catbot-header-avatar img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.catbot-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cb-text-primary);
  line-height: 1.2;
}

.catbot-header-status {
  font-size: 0.72rem;
  color: var(--cb-brand-emerald);
  display: flex;
  align-items: center;
  gap: 5px;
}

.catbot-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cb-brand-emerald);
  box-shadow: 0 0 6px var(--cb-brand-emerald);
}

/* ── MESSAGES BODY ── */
.catbot-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catbot-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: msg-fade-in 0.3s ease;
}

@keyframes msg-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.catbot-msg.bot {
  align-self: flex-start;
}

.catbot-msg.user {
  align-self: flex-end;
}

.catbot-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
}

.catbot-msg.bot .catbot-msg-bubble {
  background: #f1f5f9;
  border: 1px solid var(--cb-border-glass);
  color: var(--cb-text-primary);
  border-top-left-radius: 4px;
}

.catbot-msg.user .catbot-msg-bubble {
  background: var(--cb-brand-emerald);
  color: #ffffff;
  font-weight: 500;
  border-top-right-radius: 4px;
}

.catbot-msg-action-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid var(--cb-brand-emerald);
  color: var(--cb-brand-emerald);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catbot-msg-action-btn:hover {
  background: var(--cb-brand-emerald);
  color: #ffffff;
}

/* QUICK SUGGESTIONS */
.catbot-suggestions {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--cb-border-glass);
  background: #f8fafc;
}

.catbot-suggestions::-webkit-scrollbar { display: none; }

.catbot-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--cb-border-glass);
  color: var(--cb-text-secondary);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catbot-chip:hover {
  background: rgba(5, 150, 105, 0.1);
  border-color: var(--cb-brand-emerald);
  color: var(--cb-brand-emerald);
}

/* ── INPUT FOOTER ── */
.catbot-footer {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid var(--cb-border-glass);
  display: flex;
  align-items: center;
  gap: 10px;
}

.catbot-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--cb-border-glass);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--cb-text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.catbot-input:focus {
  border-color: var(--cb-brand-emerald);
  background: #ffffff;
}

.catbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cb-brand-emerald);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.catbot-send-btn:hover {
  transform: scale(1.08);
}

@media (max-width: 480px) {
  .catbot-trigger {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  .catbot-trigger .catbot-logo-img {
    width: 38px;
    height: 38px;
  }
  .catbot-window {
    right: 15px;
    bottom: 80px;
    width: calc(100vw - 30px);
    height: calc(100vh - 110px);
    max-height: 520px;
  }
}
