/* assets/css/ai_widget.css - Modern Responsive AI Support Assistant Widget */

:root {
  --ai-primary: #2563eb;
  --ai-primary-hover: #1d4ed8;
  --ai-bg: #ffffff;
  --ai-text: #0f172a;
  --ai-text-muted: #64748b;
  --ai-bot-bubble: #f1f5f9;
  --ai-user-bubble: #2563eb;
  --ai-border: #e2e8f0;
  --ai-radius: 18px;
  --ai-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.22), 0 8px 16px -4px rgba(0, 0, 0, 0.12);
}

/* Floating Launch Button */
.ai-widget-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.ai-launcher-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-primary), #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid #ffffff;
  position: relative;
}

.ai-launcher-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(37, 99, 235, 0.65);
}

.ai-pulse-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(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-launcher-tooltip {
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  animation: ai-float 3s ease-in-out infinite;
}

@keyframes ai-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Chat Window Modal / Drawer */
.ai-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: var(--ai-bg);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow);
  border: 1px solid var(--ai-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Chat Header */
.ai-chat-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  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-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.ai-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  line-height: 1.2;
}

.ai-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.ai-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Chat Messages Stream */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: ai-msg-slide 0.25s ease forwards;
}

@keyframes ai-msg-slide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.ai-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  word-break: break-word;
}

.ai-msg-user .ai-bubble {
  background: var(--ai-user-bubble);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.ai-msg-bot .ai-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid var(--ai-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ai-msg-time {
  font-size: 0.7rem;
  color: var(--ai-text-muted);
  margin-top: 4px;
  align-self: flex-end;
}

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

/* Typing Indicator */
.ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.ai-typing span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Interactive Action Cards */
.ai-action-card {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.ai-paystack-card {
  border-left: 4px solid #00c3f7;
  background: #f0fdfa;
}

.ai-voucher-card {
  border: 2px dashed #16a34a;
  background: #f0fdf4;
}

.ai-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.ai-btn-paystack {
  background: #0ba4db;
  color: #ffffff;
}

.ai-btn-paystack:hover {
  background: #0284c7;
}

.ai-btn-copy {
  background: #16a34a;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Quick Reply Chips */
.ai-quick-replies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid var(--ai-border);
  scrollbar-width: none;
}

.ai-quick-replies::-webkit-scrollbar {
  display: none;
}

.ai-chip {
  background: #f1f5f9;
  border: 1px solid var(--ai-border);
  color: #334155;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-chip:hover {
  background: var(--ai-primary);
  color: #ffffff;
  border-color: var(--ai-primary);
}

/* Chat Input Footer */
.ai-chat-input-box {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--ai-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-input-field {
  flex: 1;
  border: 1px solid var(--ai-border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.ai-input-field:focus {
  border-color: var(--ai-primary);
  background: #ffffff;
}

.ai-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid var(--ai-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-attach-btn:hover {
  background: #e2e8f0;
  color: var(--ai-primary);
  border-color: var(--ai-primary);
}

.ai-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ai-primary);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-send-btn:hover {
  background: var(--ai-primary-hover);
  transform: scale(1.05);
}

.ai-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* MoMo Direct Charge & Live Countdown Timer Card */
.ai-momo-card {
  border: 2px solid #38bdf8;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.12);
  margin-top: 10px;
}

.ai-momo-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: #0284c7;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-pulse-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 3px 8px;
  border-radius: 12px;
}

.ai-pulse-dot-yellow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  animation: ai-pulse-yellow 1.5s infinite;
}

@keyframes ai-pulse-yellow {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.ai-countdown-box {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}

.ai-countdown-digits {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0284c7;
}

.ai-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e0f2fe;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.ai-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  border-radius: 4px;
  transition: width 1s linear;
}

.ai-verified-box {
  background: #f0fdf4;
  border: 2px dashed #16a34a;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  animation: ai-msg-slide 0.3s ease;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 480px) {
  .ai-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .ai-widget-launcher {
    bottom: 16px;
    right: 16px;
  }
}
