/* ────────────────────────────────────────────────────────
   PHINS IQ CATBOT PREMIUM CYBER STYLING
   Glassmorphic Deep Midnight & Electric Cyan Theme
   Powered by ParroPhins Private Limited
   ──────────────────────────────────────────────────────── */

:root {
  --cb-bg-dark: #0a1124;
  --cb-bg-card: rgba(20, 32, 56, 0.96);
  --cb-border-cyan: rgba(0, 240, 255, 0.4);
  --cb-cyan-glow: rgba(0, 240, 255, 0.25);
  --cb-primary-blue: #0066ff;
  --cb-text-main: #ffffff;
  --cb-text-muted: #cbd5e1;
  --cb-text-dim: #94a3b8;
  --cb-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.2);
}

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

/* ── FLOATING TRIGGER BUTTON ── */
.catbot-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #00f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483645 !important;
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.45);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
  padding: 4px;
}

.catbot-trigger::before {
  content: '';
  position: absolute;
  top: -3px; left: -3px; right: -3px; bottom: -3px;
  border-radius: 50%;
  border: 2px solid #00f0ff;
  opacity: 0.7;
  animation: catbot-pulse 2s infinite;
  pointer-events: none;
}

.catbot-trigger::after {
  content: '×';
  position: absolute;
  font-size: 32px;
  font-weight: 300;
  color: #00f0ff;
  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.06);
  box-shadow: 0 12px 35px rgba(0, 240, 255, 0.5);
}

.catbot-trigger.active {
  background: #142038;
  border-color: #00f0ff;
  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.18); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* ── PEEK TOOLTIP BUBBLE ── */
.catbot-peek {
  position: fixed;
  bottom: 38px;
  right: 98px;
  background: rgba(20, 32, 56, 0.95);
  border: 1px solid var(--cb-border-cyan);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 0.85rem;
  max-width: 240px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 2147483644;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

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

.catbot-peek::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(20, 32, 56, 0.95);
}

/* ── CHAT WINDOW ── */
.catbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 36px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: var(--cb-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cb-border-cyan);
  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.92);
  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: linear-gradient(135deg, rgba(0, 102, 255, 0.3), rgba(0, 240, 255, 0.15));
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  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: 10px;
  background: rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

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

.catbot-header-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #ffffff;
}

.catbot-header-status {
  font-size: 0.75rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 6px;
}

.catbot-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

/* Messages Body */
.catbot-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catbot-body::-webkit-scrollbar {
  width: 4px;
}
.catbot-body::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}

.catbot-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

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

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

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

.catbot-msg.bot .catbot-msg-bubble {
  background: rgba(30, 48, 80, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.catbot-msg.user .catbot-msg-bubble {
  background: linear-gradient(135deg, #0066ff, #0284c7);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.catbot-msg-action-btn {
  margin-top: 8px;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catbot-msg-action-btn:hover {
  background: #00f0ff;
  color: #0a1124;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
}

/* Suggestion Chips */
.catbot-suggestions {
  padding: 10px 16px 14px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.catbot-suggestions::-webkit-scrollbar { display: none; }

.catbot-chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #cbd5e1;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catbot-chip:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00f0ff;
  color: #00f0ff;
}

/* Footer Input Area */
.catbot-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  background: rgba(10, 17, 36, 0.9);
}

.catbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 10px 16px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.catbot-input:focus {
  border-color: #00f0ff;
}

.catbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066ff, #00f0ff);
  border: none;
  color: #0a1124;
  font-weight: 800;
  font-size: 1rem;
  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-peek {
    bottom: 92px;
    right: 16px;
    max-width: calc(100vw - 32px);
    font-size: 0.78rem;
    padding: 8px 12px;
  }
  .catbot-peek::after {
    display: none;
  }
  .catbot-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 84px;
    height: 75vh;
  }
}
