/* ==============================================================================
   GARG PHARMACEUTICALS - 24/7 AI PHARMA COPILOT STYLES
   Ultra-modern, glassmorphism, responsive pharmaceutical assistant widget
   ============================================================================== */

:root {
  --ai-primary: #16a34a;
  --ai-primary-dark: #15803d;
  --ai-primary-light: #dcfce7;
  --ai-accent: #0284c7;
  --ai-dark: #0f172a;
  --ai-card-bg: #ffffff;
  --ai-text-main: #1e293b;
  --ai-text-sub: #64748b;
  --ai-border: #e2e8f0;
  --ai-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 20px rgba(22, 163, 74, 0.15);
}

/* Floating AI Button */
.ai-copilot-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #16a34a 0%, #0d9488 100%);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 9999px;
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.4);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, sans-serif;
  user-select: none;
}

.ai-copilot-trigger:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 32px rgba(22, 163, 74, 0.55);
}

.ai-trigger-icon {
  width: 28px;
  height: 28px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-trigger-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
}

.ai-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseAura 2s infinite;
}

@keyframes pulseAura {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.ai-trigger-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ai-trigger-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.ai-trigger-sub {
  font-size: 0.72rem;
  opacity: 0.9;
  font-weight: 600;
}

/* Chat Modal Window */
.ai-copilot-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--ai-shadow);
  border: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, sans-serif;
}

.ai-copilot-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.ai-window-header {
  background: linear-gradient(135deg, #064e3b 0%, #0f766e 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-header-avatar svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  fill: none;
}

.ai-header-info h4 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.ai-header-info span {
  font-size: 0.74rem;
  color: #a7f3d0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-online-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  display: inline-block;
  box-shadow: 0 0 6px #34d399;
}

.ai-header-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.ai-header-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages Body */
.ai-window-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-message {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

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

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ai-msg-bot .ai-bubble {
  background: #ffffff;
  color: var(--ai-text-main);
  border: 1px solid var(--ai-border);
  border-top-left-radius: 4px;
}

.ai-msg-user .ai-bubble {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
  font-weight: 500;
}

/* Quick Action Pills */
.ai-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.ai-pill-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-pill-btn:hover {
  border-color: #16a34a;
  color: #16a34a;
  background: #f0fdf4;
  transform: translateY(-1px);
}

/* Medicine Mini-Card in Chat */
.ai-prod-minicard {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #16a34a;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ai-minicard-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
}

.ai-minicard-salt {
  font-size: 0.78rem;
  color: #0284c7;
  font-weight: 600;
}

.ai-minicard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

.ai-minicard-rates {
  font-weight: 700;
  color: #16a34a;
}

.ai-minicard-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #25d366;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}

.ai-minicard-btn:hover {
  background: #1eb757;
}

/* Footer / Input */
.ai-window-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--ai-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.ai-chat-input {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  background: #f8fafc;
}

.ai-chat-input:focus {
  border-color: #16a34a;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #16a34a;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-send-btn:hover {
  background: #15803d;
  transform: scale(1.06);
}

.ai-send-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Scheme Modal Styles */
.scheme-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.scheme-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.scheme-modal-box {
  background: #ffffff;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
}

.scheme-modal-overlay.active .scheme-modal-box {
  transform: scale(1);
}

.scheme-modal-header {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  color: #ffffff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scheme-modal-body {
  padding: 24px;
}

.scheme-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
}

.scheme-profit-highlight {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 16px;
  margin-top: 18px;
  text-align: center;
}

.scheme-profit-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #047857;
}

/* ==============================================================================
   FEATURE 1: PARCHI SCANNER & ATTACH BUTTON
   ============================================================================== */
.ai-attach-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  user-select: none;
}

.ai-attach-btn:hover {
  background: #e2e8f0;
  border-color: #16a34a;
  color: #16a34a;
  transform: scale(1.05);
}

/* ==============================================================================
   FEATURE 3: MULTI-ITEM ORDER CART & DRAWER
   ============================================================================== */
.ai-minicard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.ai-minicard-addcart-btn {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.ai-minicard-addcart-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.ai-cart-bar {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 -3px 12px rgba(6, 95, 70, 0.25);
  font-size: 0.85rem;
  z-index: 10;
  animation: slideUp 0.25s ease;
}

.ai-cart-bar:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.ai-cart-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-cart-bar-badge {
  background: #22c55e;
  color: #0f172a;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 9999px;
}

.ai-cart-bar-action {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Slide-up Cart Drawer */
.ai-cart-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 60px;
  max-height: 400px;
  background: #ffffff;
  border-top: 2px solid #16a34a;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateY(105%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.2s ease;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.ai-cart-drawer.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ai-cart-drawer-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.ai-cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.ai-cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
}

.ai-cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  gap: 8px;
}

.ai-cart-item-info {
  flex: 1;
  min-width: 0;
}

.ai-cart-item-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-cart-item-rate {
  font-size: 0.74rem;
  color: #16a34a;
  font-weight: 700;
}

.ai-cart-item-ctrls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.ai-qty-btn:hover {
  background: #e2e8f0;
}

.ai-qty-val {
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
}

.ai-item-del-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
}

.ai-cart-drawer-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.ai-cart-btn-clear {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.ai-cart-btn-clear:hover {
  background: #e2e8f0;
}

.ai-cart-btn-wa {
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.ai-cart-btn-wa:hover {
  background: #1eb757;
}

/* ==============================================================================
   FEATURE 6: QUOTATION & PRICE LIST CARD
   ============================================================================== */
/* ==============================================================================
   FEATURE 6: LUXURY QUOTATION & PRICE LIST CARD
   ============================================================================== */
.ai-quotation-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 1.5px solid #86efac;
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.12);
  position: relative;
  overflow: hidden;
}

.ai-quotation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #16a34a, #059669, #0284c7);
}

.ai-quotation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ai-quotation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
}

.ai-quotation-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 4px 0 2px;
}

.ai-quotation-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 6px;
  margin: 10px 0;
  text-align: center;
}

.ai-quotation-stat-box {
  display: flex;
  flex-direction: column;
}

.ai-quotation-stat-val {
  font-size: 0.86rem;
  font-weight: 900;
  color: #065f46;
}

.ai-quotation-stat-lbl {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

.ai-quotation-company-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 10px;
}

.ai-quotation-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-quotation-pill:hover,
.ai-quotation-pill.active {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.ai-quotation-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.ai-quotation-btn {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.ai-btn-excel {
  background: linear-gradient(135deg, #107c41 0%, #15803d 100%);
  color: #ffffff;
}

.ai-btn-excel:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 124, 65, 0.35);
}

.ai-btn-pdf {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
}

.ai-btn-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
}

.ai-quotation-wa-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  margin-top: 10px;
  font-size: 0.76rem;
  color: #15803d;
  font-weight: 800;
  text-decoration: none;
  padding: 6px;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 8px;
  transition: background 0.2s;
}

.ai-quotation-wa-link:hover {
  background: rgba(34, 197, 94, 0.18);
  text-decoration: none;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  .ai-copilot-window {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: 540px;
  }
  .ai-copilot-trigger {
    right: 16px;
    bottom: 16px;
    padding: 10px 16px;
  }
  .ai-cart-drawer {
    bottom: 56px;
    max-height: 320px;
  }
}
