/* ============================================
   QuickHealth — Vita AI Chatbot Widget
   Premium Glassmorphism + Healthcare Design
   ============================================ */

/* ─── Variables ─────────────────────────────── */
:root {
  --vt-primary: #00B4D8;
  --vt-primary-dark: #0096B7;
  --vt-accent: #10B981;
  --vt-gradient: linear-gradient(135deg, #00B4D8 0%, #0077B6 50%, #023E8A 100%);
  --vt-gradient-soft: linear-gradient(135deg, #00B4D8 0%, #48CAE4 100%);
  --vt-gradient-warm: linear-gradient(135deg, #0096B7 0%, #00B4D8 40%, #48CAE4 100%);
  --vt-glass-bg: rgba(255, 255, 255, 0.92);
  --vt-glass-border: rgba(255, 255, 255, 0.35);
  --vt-dark-bg: #0A1628;
  --vt-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
  --vt-shadow-fab: 0 8px 32px rgba(0, 180, 216, 0.35), 0 2px 8px rgba(0, 119, 182, 0.2);
  --vt-radius: 22px;
  --vt-msg-radius: 18px;
  --vt-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── FAB Button — Premium Healthcare ──────────── */
.vt-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: var(--vt-gradient);
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--vt-shadow-fab);
  transition: var(--vt-transition);
  animation: vt-fab-entrance 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: visible;
  padding: 0;
}

/* Outer glow ring */
.vt-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 26px;
  background: var(--vt-gradient);
  z-index: -1;
  animation: vt-glow-pulse 3s ease-in-out infinite;
  opacity: 0;
  filter: blur(8px);
}

/* Inner shine */
.vt-fab::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  right: 6px;
  height: 50%;
  border-radius: 18px 18px 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.vt-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 44px rgba(0, 180, 216, 0.5), 0 4px 12px rgba(0, 119, 182, 0.3);
  border-radius: 24px;
}

.vt-fab:active {
  transform: translateY(0) scale(0.97);
}

/* Mascot image inside FAB */
.vt-fab-mascot {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  transition: var(--vt-transition);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  position: relative;
  z-index: 1;
}

.vt-fab-close-icon {
  display: none;
  font-size: 22px;
  color: #fff;
  position: relative;
  z-index: 1;
}

.vt-fab.open .vt-fab-mascot {
  display: none;
}

.vt-fab.open .vt-fab-close-icon {
  display: inline;
}

/* Notification badge */
.vt-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  border-radius: 50%;
  border: 2.5px solid #fff;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vt-badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

/* Tooltip label */
.vt-fab-tooltip {
  position: absolute;
  right: 78px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #1E293B;
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(-50%) translateX(8px);
  z-index: 1;
}

.vt-fab-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #1E293B;
}

.vt-fab:hover .vt-fab-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.vt-fab.open .vt-fab-tooltip {
  display: none;
}

/* ─── Chat Window ──────────────────────────────── */
.vt-window {
  position: fixed;
  bottom: 106px;
  right: 28px;
  width: 400px;
  max-height: 600px;
  border-radius: var(--vt-radius);
  background: var(--vt-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--vt-glass-border);
  box-shadow: var(--vt-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ─── Chat Header ──────────────────────────────── */
.vt-header {
  background: var(--vt-gradient);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.vt-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.vt-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.vt-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.25);
  overflow: hidden;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
}

.vt-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.vt-header-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.vt-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.vt-header-subtitle {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
  font-weight: 400;
}

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

.vt-header-status .vt-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  animation: vt-status-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.vt-header-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--vt-transition);
  flex-shrink: 0;
  z-index: 1;
}

.vt-header-close:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(90deg);
}

/* ─── Messages Container ──────────────────────── */
.vt-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 380px;
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #F8FAFE 0%, #EFF4FB 100%);
}

.vt-messages::-webkit-scrollbar {
  width: 4px;
}

.vt-messages::-webkit-scrollbar-track {
  background: transparent;
}

.vt-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 180, 216, 0.2);
  border-radius: 10px;
}

/* ─── Message Bubbles ─────────────────────────── */
.vt-msg {
  display: flex;
  gap: 8px;
  animation: vt-msg-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.vt-msg-bot {
  align-self: flex-start;
  max-width: 85%;
}

.vt-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 80%;
}

.vt-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
  overflow: hidden;
}

.vt-msg-bot .vt-msg-avatar {
  background: linear-gradient(135deg, rgba(0,180,216,0.1), rgba(0,119,182,0.1));
  border: 1px solid rgba(0,180,216,0.15);
}

.vt-msg-bot .vt-msg-avatar img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.vt-msg-user .vt-msg-avatar {
  background: #E2E8F0;
  color: #475569;
  font-size: 13px;
}

.vt-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--vt-msg-radius);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #1E293B;
  position: relative;
  word-wrap: break-word;
}

.vt-msg-bot .vt-msg-bubble {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.vt-msg-user .vt-msg-bubble {
  background: var(--vt-gradient-soft);
  color: #fff;
  border-bottom-right-radius: 6px;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.2);
}

.vt-msg-bubble strong,
.vt-msg-bubble b {
  font-weight: 600;
}

.vt-msg-bubble a {
  color: var(--vt-primary);
  text-decoration: underline;
  font-weight: 500;
}

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

.vt-msg-bubble ul,
.vt-msg-bubble ol {
  margin: 8px 0 4px 0;
  padding-left: 18px;
}

.vt-msg-bubble li {
  margin-bottom: 4px;
}

/* ─── Feedback Buttons ─────────────────────────── */
.vt-feedback {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.vt-feedback-btn {
  background: none;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94A3B8;
  transition: var(--vt-transition);
}

.vt-feedback-btn:hover {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

.vt-feedback-btn.active-positive {
  background: #ECFDF5;
  color: #059669;
  border-color: #A7F3D0;
}

.vt-feedback-btn.active-negative {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.vt-feedback-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* ─── Services CTA Button ─────────────────────── */
.vt-services-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 18px;
  background: var(--vt-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--vt-transition);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);
}

.vt-services-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
}

/* ─── Typing Indicator ─────────────────────────── */
.vt-typing {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  max-width: 85%;
  animation: vt-msg-appear 0.3s ease forwards;
}

.vt-typing-bubble {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: var(--vt-msg-radius);
  border-bottom-left-radius: 6px;
  padding: 14px 20px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.vt-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94A3B8;
  animation: vt-typing-bounce 1.4s ease-in-out infinite;
}

.vt-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.vt-typing-dot:nth-child(3) { animation-delay: 0.32s; }

/* ─── Input Area ──────────────────────────────── */
.vt-input-area {
  padding: 14px 16px;
  background: #fff;
  border-top: 1px solid #E8EDF4;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.vt-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: #F1F5F9;
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  border: 2px solid transparent;
  transition: var(--vt-transition);
}

.vt-input-wrapper:focus-within {
  border-color: var(--vt-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.vt-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 0.875rem;
  font-family: inherit;
  color: #1E293B;
  padding: 8px 0;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
}

.vt-input::placeholder {
  color: #94A3B8;
}

.vt-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--vt-gradient);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--vt-transition);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.25);
}

.vt-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 180, 216, 0.4);
}

.vt-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Welcome Message Chips ───────────────────── */
.vt-welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.vt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(0,180,216,0.06), rgba(0,119,182,0.06));
  border: 1px solid rgba(0,180,216,0.18);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--vt-primary-dark);
  cursor: pointer;
  transition: var(--vt-transition);
  font-weight: 500;
}

.vt-chip:hover {
  background: linear-gradient(135deg, rgba(0,180,216,0.14), rgba(0,119,182,0.14));
  border-color: var(--vt-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.12);
}

/* ─── Powered By ──────────────────────────────── */
.vt-powered {
  text-align: center;
  padding: 6px 16px 10px;
  font-size: 0.65rem;
  color: #94A3B8;
  background: #fff;
  letter-spacing: 0.3px;
}

.vt-powered span {
  font-weight: 600;
  color: #64748B;
}

/* ─── Animations ──────────────────────────────── */
@keyframes vt-fab-entrance {
  from { opacity: 0; transform: scale(0) rotate(-180deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes vt-glow-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}

@keyframes vt-badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

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

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

@keyframes vt-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
  .vt-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .vt-window.open {
    height: 100vh;
    height: 100dvh;
  }

  .vt-messages {
    max-height: none;
    flex: 1;
  }

  .vt-fab {
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .vt-fab-mascot { width: 38px; height: 38px; }
  .vt-fab-tooltip { display: none !important; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .vt-window { width: 360px; right: 16px; bottom: 96px; }
  .vt-fab { bottom: 20px; right: 20px; }
}

/* ─── Hide WhatsApp FAB (replaced by Vita) ─────── */
.whatsapp-fab {
  display: none !important;
}
