/* ═══════════════════════════════════════════
   ALL INDIA TOURS — CHATBOT WIDGET STYLES
   Premium glassmorphism design
   ═══════════════════════════════════════════ */

/* ─── Widget Container ─── */
#chatbot-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 1100;
  font-family: 'Inter', sans-serif;
}

/* ─── Trigger Button ─── */
.cb-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #b8860b, #d4a853);
  color: #fff;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 28px rgba(184, 134, 11, 0.35),
              0 0 0 0 rgba(184, 134, 11, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.cb-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 36px rgba(184, 134, 11, 0.45);
}

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

.cb-trigger-icon {
  width: 26px;
  height: 26px;
  display: flex;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-trigger-icon svg {
  width: 100%;
  height: 100%;
}

.cb-trigger-close {
  position: absolute;
  font-size: 20px;
  font-weight: 300;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-open .cb-trigger-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.cb-open .cb-trigger-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Pulse animation */
.cb-trigger-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(184, 134, 11, 0.4);
  animation: cbPulse 2.5s infinite;
}

.cb-open .cb-trigger-pulse {
  animation: none;
  opacity: 0;
}

@keyframes cbPulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Notification badge */
.cb-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: cbBadgeBounce 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cbBadgeBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ─── Chat Window ─── */
.cb-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 370px;
  max-height: 520px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(184, 134, 11, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  flex-direction: column;

  /* Animate in/out */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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

/* ─── Header ─── */
.cb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

.cb-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b8860b, #d4a853, #b8860b);
}

.cb-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8860b, #d4a853);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
  position: relative;
}

.cb-avatar-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0f172a;
}

.cb-header-info {
  flex: 1;
  min-width: 0;
}

.cb-header-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.cb-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.cb-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: cbStatusPulse 2s infinite;
}

@keyframes cbStatusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.cb-header-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.cb-header-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ─── Messages Area ─── */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  max-height: 300px;
  scroll-behavior: smooth;
}

/* Scrollbar */
.cb-messages::-webkit-scrollbar {
  width: 4px;
}
.cb-messages::-webkit-scrollbar-track {
  background: transparent;
}
.cb-messages::-webkit-scrollbar-thumb {
  background: rgba(184, 134, 11, 0.2);
  border-radius: 4px;
}

/* ─── Message Bubbles ─── */
.cb-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: cbMsgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cbMsgIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

.cb-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.84rem;
  line-height: 1.6;
  word-break: break-word;
}

.cb-msg-bot .cb-bubble {
  background: #f1f5f9;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.cb-msg-user .cb-bubble {
  background: linear-gradient(135deg, #b8860b, #d4a853);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 12px rgba(184, 134, 11, 0.2);
}

.cb-time {
  font-size: 0.6rem;
  color: #94a3b8;
  margin-top: 4px;
  padding: 0 4px;
}

.cb-msg-user .cb-time {
  text-align: right;
}

/* ─── Typing Indicator ─── */
.cb-typing .cb-bubble {
  display: flex;
  gap: 5px;
  padding: 14px 20px;
}

.cb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: cbDotBounce 1.4s infinite;
}

.cb-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.cb-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes cbDotBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ─── Tour Items inside messages ─── */
.cb-tour-item {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  transition: all 0.3s;
}

.cb-tour-item:hover {
  border-color: rgba(184, 134, 11, 0.2);
  background: rgba(184, 134, 11, 0.04);
}

.cb-tour-item strong {
  color: #0f172a;
  font-size: 0.85rem;
}

.cb-tour-item small {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.4;
}

.cb-price {
  color: #b8860b;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.cb-tour-detail {
  line-height: 1.7;
}

.cb-bubble a {
  color: #b8860b;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s;
}

.cb-bubble a:hover {
  color: #d4a853;
}

.cb-msg-user .cb-bubble a {
  color: #fff;
}

/* ─── Quick Replies ─── */
.cb-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  max-height: 90px;
  overflow-y: auto;
}

.cb-qr {
  padding: 7px 14px;
  border-radius: 50px;
  border: 1px solid rgba(184, 134, 11, 0.2);
  background: rgba(184, 134, 11, 0.04);
  color: #b8860b;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.cb-qr:hover {
  background: linear-gradient(135deg, #b8860b, #d4a853);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(184, 134, 11, 0.2);
}

/* ─── Input Area ─── */
.cb-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.cb-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.84rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s;
}

.cb-input:focus {
  border-color: rgba(184, 134, 11, 0.4);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.08);
  background: #fff;
}

.cb-input::placeholder {
  color: #94a3b8;
}

.cb-send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #b8860b, #d4a853);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.cb-send svg {
  width: 18px;
  height: 18px;
}

.cb-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(184, 134, 11, 0.3);
}

.cb-send:active {
  transform: scale(0.95);
}

/* ─── Mobile Responsive ─── */
@media (max-width: 480px) {
  #chatbot-widget {
    bottom: 82px;
    right: 12px;
  }

  .cb-window {
    width: calc(100vw - 24px);
    right: -8px;
    max-height: 70vh;
    border-radius: 16px;
  }

  .cb-trigger {
    width: 52px;
    height: 52px;
  }

  .cb-trigger-icon {
    width: 22px;
    height: 22px;
  }

  .cb-messages {
    min-height: 180px;
    max-height: 45vh;
  }
}

@media (max-width: 370px) {
  .cb-window {
    width: calc(100vw - 16px);
    right: -6px;
  }
}
