/* ========== CHATBOT — GLASS CRYSTAL ========== */
.chatbot-wrapper {
  position: fixed; bottom: 28px; right: 28px;
  z-index: 9999;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.chatbot-toggle {
  width: 68px; height: 68px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.55);
  background: linear-gradient(135deg, #0877ff, #1455db 55%, #06cfae);
  background-size: 200% 200%;
  animation: cbGradientMove 4s ease infinite;
  color: #fff; font-size: 28px; cursor: pointer;
  box-shadow: 0 15px 40px rgba(8, 119, 255, 0.5), inset 0 1px 0 rgba(255,255,255,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.chatbot-toggle:hover {
  transform: scale(1.12) rotate(-8deg);
  box-shadow: 0 25px 60px rgba(8, 119, 255, 0.7), inset 0 1px 0 rgba(255,255,255,0.65);
}
.chatbot-toggle::before {
  content: ''; position: absolute; inset: -5px;
  border-radius: 50%; border: 2px solid rgba(8, 119, 255, 0.45);
  animation: cbPulseRing 2s ease-out infinite;
}
.chatbot-toggle.open { transform: rotate(90deg) scale(1.05); }
.chatbot-toggle.open::before { animation: none; opacity: 0; }

.chatbot-badge {
  position: absolute; top: -2px; right: -2px;
  width: 20px; height: 20px; background: #5cff18;
  border-radius: 50%; border: 3px solid #fff;
  animation: cbPulse 1.5s ease-in-out infinite;
  display: none;
  box-shadow: 0 0 15px rgba(92,255,24,0.9);
}
.chatbot-badge.show { display: block; }

.chatbot-window {
  position: absolute; bottom: 90px; right: 0;
  width: 420px; max-width: calc(100vw - 40px);
  height: 640px; max-height: calc(100vh - 130px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 40px 100px rgba(6, 26, 73, 0.3), inset 0 1px 0 rgba(255,255,255,1);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(20px) scale(0.92);
  transform-origin: bottom right;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.chatbot-window.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.chatbot-header {
  background: linear-gradient(135deg, #041438, #0a2b72 58%, #0b58c7);
  background-size: 200% 200%;
  animation: cbGradientMove 8s ease infinite;
  padding: 20px 22px; color: #fff;
  display: flex; align-items: center; gap: 14px;
  position: relative; overflow: hidden;
}
.chatbot-header::after {
  content: ''; position: absolute; top: -50%; left: -100%;
  width: 200%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: cbShimmer 4s infinite;
}
.chatbot-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #00d8ff, #5cff18);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; position: relative; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0, 216, 255, 0.55), inset 0 1px 0 rgba(255,255,255,0.6);
}
.chatbot-avatar::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 13px; height: 13px; background: #5cff18;
  border: 2px solid #0a2b72; border-radius: 50%;
  animation: cbPulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px #5cff18;
}
.chatbot-header-info { flex: 1; position: relative; z-index: 1; }
.chatbot-header-info h4 { margin: 0; font-size: 15px; font-weight: 800; }
.chatbot-header-info span {
  font-size: 12px; color: #c9d8f5;
  display: flex; align-items: center; gap: 5px;
}
.chatbot-header-info span::before {
  content: ''; width: 7px; height: 7px;
  background: #5cff18; border-radius: 50%;
  box-shadow: 0 0 8px #5cff18;
}
.chatbot-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff; width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; position: relative; z-index: 1;
  backdrop-filter: blur(10px);
}
.chatbot-close:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }

.chatbot-messages {
  flex: 1; padding: 22px 20px; overflow-y: auto;
  background: rgba(255, 255, 255, 0.55);
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0877ff, #06cfae); border-radius: 3px;
}

.cb-msg {
  max-width: 82%; padding: 13px 17px; border-radius: 18px;
  font-size: 14px; line-height: 1.55;
  animation: cbMsgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  word-wrap: break-word;
}
@keyframes cbMsgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cb-msg.bot {
  background: rgba(255, 255, 255, 0.95);
  color: #0a1530; align-self: flex-start;
  border: 1px solid rgba(255,255,255,1);
  border-bottom-left-radius: 6px;
  box-shadow: 0 6px 20px rgba(6, 26, 73, 0.08), inset 0 1px 0 rgba(255,255,255,1);
}
.cb-msg.user {
  background: linear-gradient(135deg, #0877ff, #06cfae);
  color: #fff; align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 20px rgba(8, 119, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}
.cb-msg a { color: #0877ff; font-weight: 700; text-decoration: underline; }
.cb-msg.user a { color: #fff; }

.cb-typing {
  display: flex; gap: 5px; padding: 15px 19px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255,255,255,1);
  border-radius: 18px; border-bottom-left-radius: 6px;
  align-self: flex-start;
  box-shadow: 0 6px 20px rgba(6, 26, 73, 0.08);
}
.cb-typing span {
  width: 8px; height: 8px;
  background: linear-gradient(135deg, #0877ff, #06cfae);
  border-radius: 50%; animation: cbTyping 1.4s infinite;
}
.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cbTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

.cb-quick-replies {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 20px 14px;
  background: rgba(255, 255, 255, 0.55);
}
.cb-chip {
  padding: 9px 15px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(8, 119, 255, 0.25);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: #0877ff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1);
}
.cb-chip:hover {
  background: linear-gradient(135deg, #0877ff, #06cfae);
  color: #fff; border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(8, 119, 255, 0.4);
}

.chatbot-input {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}
.chatbot-input input {
  flex: 1;
  border: 1px solid rgba(8, 119, 255, 0.18);
  border-radius: 999px;
  padding: 13px 20px; font: inherit; font-size: 14px;
  outline: none; transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1);
}
.chatbot-input input:focus {
  border-color: #0877ff; background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 119, 255, 0.14), inset 0 1px 0 rgba(255,255,255,1);
}
.chatbot-send {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: linear-gradient(135deg, #0877ff, #06cfae);
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(8, 119, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.5);
}
.chatbot-send:hover {
  transform: scale(1.1) rotate(-10deg);
  box-shadow: 0 10px 28px rgba(8, 119, 255, 0.6);
}
.chatbot-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chatbot-branding {
  text-align: center; font-size: 11px;
  color: #9aaac4; padding: 0 0 10px;
  background: rgba(255, 255, 255, 0.85);
}
.chatbot-branding strong { color: #0877ff; }

@keyframes cbGradientMove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes cbPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: 0.7; } }
@keyframes cbPulseRing { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes cbShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

@media (max-width: 600px) {
  .chatbot-wrapper { bottom: 18px; right: 18px; }
  .chatbot-toggle { width: 60px; height: 60px; font-size: 24px; }
  .chatbot-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
    bottom: 80px; right: -6px; border-radius: 22px;
  }
  .cb-msg { max-width: 88%; font-size: 13.5px; }
  .chatbot-header { padding: 14px 16px; }
  .chatbot-avatar { width: 38px; height: 38px; font-size: 18px; }
}