/* ────────────────────────────────────────────────────────
   CATBOT PREMIUM STYLING
   Glassmorphic dark design with dynamic neon glows
   ──────────────────────────────────────────────────────── */

:root {
  --cb-bg-glass: rgba(15, 23, 42, 0.82);
  --cb-border-glass: rgba(255, 255, 255, 0.08);
  --cb-glow-green: #10b981;
  --cb-glow-blue: #0ea5e9;
  --cb-gradient-accent: linear-gradient(135deg, #10b981, #0ea5e9);
  --cb-text-primary: #f8fafc;
  --cb-text-secondary: #94a3b8;
  --cb-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Hide Chatbot completely while page is loading */
body.loading #catbot-root {
  display: none !important;
}

/* ── FLOATING TRIGGER BUTTON ── */
.catbot-trigger {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--cb-gradient-accent);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483645 !important;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

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

.catbot-trigger:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 40px rgba(16, 185, 129, 0.5);
}

.catbot-trigger:active {
  transform: scale(0.95);
}

.catbot-trigger .dolphin-svg {
  width: 28px;
  height: 28px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  stroke: #ffffff;
}

.catbot-trigger.active {
  transform: rotate(90deg) scale(0.9);
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--cb-border-glass);
  box-shadow: var(--cb-shadow);
}

.catbot-trigger.active .dolphin-svg {
  stroke: var(--cb-glow-green);
}

/* ── WELCOME PEEK BUBBLE ── */
.catbot-peek {
  position: fixed;
  bottom: 168px;
  right: 30px;
  background: var(--cb-bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cb-border-glass);
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  color: var(--cb-text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--cb-shadow);
  z-index: 2147483645 !important;
  max-width: 250px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.catbot-peek.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  cursor: pointer;
}

.catbot-peek::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 15px;
  border-width: 6px 6px 0 0;
  border-style: solid;
  border-color: var(--cb-bg-glass) transparent;
  display: block;
  width: 0;
}

/* ── CHAT WINDOW ── */
.catbot-window {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 380px;
  height: 520px;
  background: var(--cb-bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--cb-border-glass);
  border-radius: 24px;
  box-shadow: var(--cb-shadow);
  z-index: 2147483646 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.92);
  pointer-events: none;
  transition: all 0.4s 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: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--cb-border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.catbot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cb-gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.catbot-avatar svg {
  width: 20px;
  height: 20px;
}

.catbot-info {
  display: flex;
  flex-direction: column;
}

.catbot-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cb-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.catbot-status-dot {
  width: 6px;
  height: 6px;
  background: var(--cb-glow-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cb-glow-green);
  animation: catbot-blink 1.5s infinite;
}

.catbot-subtitle {
  font-size: 0.72rem;
  color: var(--cb-text-secondary);
}

.catbot-header-actions button {
  background: transparent;
  border: none;
  color: var(--cb-text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.catbot-header-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cb-text-primary);
}

/* ── MESSAGES BOX ── */
.catbot-messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar for Messages */
.catbot-messages-container::-webkit-scrollbar {
  width: 4px;
}
.catbot-messages-container::-webkit-scrollbar-track {
  background: transparent;
}
.catbot-messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.catbot-messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.catbot-msg {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  animation: catbot-msg-in 0.3s ease forwards;
}

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

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

.catbot-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.catbot-msg.bot .catbot-bubble {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--cb-text-primary);
  border-bottom-left-radius: 4px;
}

.catbot-msg.user .catbot-bubble {
  background: var(--cb-gradient-accent);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.catbot-msg-time {
  font-size: 0.65rem;
  color: var(--cb-text-secondary);
  margin-top: 4px;
  padding: 0 4px;
}

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

/* ── JUMP TO SECTION ACTIONS ── */
.catbot-msg-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catbot-action-btn {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
}

.catbot-action-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--cb-glow-green);
  color: white;
  transform: translateY(-2px);
}

/* ── SUGGESTIONS & CHIPS ── */
.catbot-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  animation: catbot-fade-in 0.5s ease forwards;
}

.catbot-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cb-text-primary);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.3s;
}

.catbot-chip:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--cb-glow-green);
  transform: scale(1.03);
}

/* Realtime Search suggestions overlay */
.catbot-suggestions-panel {
  position: absolute;
  bottom: 74px;
  left: 20px;
  right: 20px;
  max-height: 180px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  z-index: 10002;
  overflow-y: auto;
  box-shadow: var(--cb-shadow);
  display: none;
  flex-direction: column;
}

.catbot-suggestions-panel.active {
  display: flex;
}

.catbot-suggestion-item {
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--cb-text-primary);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
  text-align: left;
}

.catbot-suggestion-item:last-child {
  border-bottom: none;
}

.catbot-suggestion-item:hover {
  background: rgba(16, 185, 129, 0.12);
  color: var(--cb-glow-green);
}

/* ── INPUT FOOTER ── */
.catbot-input-form {
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid var(--cb-border-glass);
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
}

.catbot-input-wrapper {
  flex: 1;
  position: relative;
}

.catbot-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cb-text-primary);
  font-size: 0.88rem;
  transition: all 0.3s;
  outline: none;
}

.catbot-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.12);
}

.catbot-submit-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--cb-gradient-accent);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.catbot-submit-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.catbot-submit-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
}

/* ── ANIMATIONS ── */
@keyframes catbot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes catbot-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

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

@keyframes catbot-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── RESPONSIVE ADAPTATIONS ── */
@media (max-width: 600px) {
  .catbot-trigger {
    bottom: 90px;
    right: 20px;
    width: 52px;
    height: 52px;
  }
  
  .catbot-peek {
    bottom: 154px;
    right: 20px;
    font-size: 0.82rem;
  }

  .catbot-window {
    width: calc(100% - 40px);
    height: calc(100% - 160px);
    right: 20px;
    bottom: 155px;
    border-radius: 20px;
  }
}

/* ── CUSTOM CURSOR STACKING OVERRIDES ── */
.parrot-cursor,
.cursor,
.cursor-dot,
.cursor-trail {
  z-index: 2147483647 !important;
}
