/* =========================================================
   RIDA OFFICIAL — AI Chatbot Widget Stylesheet
   Dark Cyber Theme (Graphite + Electric Blue / Cyan Neon)
   ========================================================= */

:root {
  --rida-ai-bg: #0B101B;
  --rida-ai-panel-bg: rgba(11, 16, 27, 0.95);
  --rida-ai-border: rgba(0, 153, 255, 0.3);
  --rida-ai-border-hover: rgba(0, 210, 255, 0.6);
  --rida-ai-primary: #0077FF;
  --rida-ai-neon: #00D2FF;
  --rida-ai-neon-glow: rgba(0, 210, 255, 0.35);
  --rida-ai-text: #F5F7FA;
  --rida-ai-text-muted: rgba(245, 247, 250, 0.65);
  --rida-ai-bubble-bot: #101726;
  --rida-ai-bubble-user: linear-gradient(135deg, #0077FF, #00B4D8);
  --rida-ai-card-bg: #141D30;
  --rida-ai-success: #10B981;
}

/* Floating Launcher Button & Chatbot Widget Guarantee */
.chatbot-widget,
.rida-ai-launcher,
#ridaAiLauncher {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 64px !important;
  height: 64px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #0077FF, #00D2FF) !important;
  box-shadow: 0 8px 24px rgba(0, 119, 255, 0.45), 0 0 20px rgba(0, 210, 255, 0.4) !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 2147483647 !important;
  border: 2.5px solid rgba(255, 255, 255, 0.4) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  user-select: none !important;
  pointer-events: auto !important;
}

.chatbot-widget:hover,
.rida-ai-launcher:hover,
#ridaAiLauncher:hover {
  transform: scale(1.08) translateY(-3px) !important;
  box-shadow: 0 12px 32px rgba(0, 119, 255, 0.65), 0 0 28px var(--rida-ai-neon) !important;
}

.rida-ai-launcher-icon,
.rida-ai-launcher-svg {
  width: 30px !important;
  height: 30px !important;
  font-size: 28px !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.3s ease !important;
}

.rida-ai-launcher.open .rida-ai-launcher-icon,
.rida-ai-launcher.open .rida-ai-launcher-svg,
#ridaAiLauncher.open .rida-ai-launcher-svg {
  transform: rotate(90deg) !important;
}

.rida-ai-pulse-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--rida-ai-success);
  border: 2.5px solid #0B101B;
  border-radius: 50%;
  box-shadow: 0 0 8px var(--rida-ai-success);
}

.rida-ai-pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--rida-ai-success);
  animation: ridaAiPulse 2s infinite ease-out;
}

@keyframes ridaAiPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Chatbot Floating Window */
.rida-ai-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: var(--rida-ai-panel-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rida-ai-border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 153, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483646 !important;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--rida-ai-text);
}

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

/* Chat Header */
.rida-ai-header {
  padding: 16px 18px;
  background: rgba(16, 23, 38, 0.95);
  border-bottom: 1px solid var(--rida-ai-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.rida-ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0077FF, #00D2FF);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

.rida-ai-title-wrap h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--rida-ai-text);
  letter-spacing: -0.01em;
}

.rida-ai-status {
  margin: 0;
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--rida-ai-neon);
  display: flex;
  align-items: center;
  gap: 5px;
}

.rida-ai-status-dot {
  width: 7px;
  height: 7px;
  background: var(--rida-ai-success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--rida-ai-success);
}

.rida-ai-header-actions {
  display: flex;
  gap: 8px;
}

.rida-ai-btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--rida-ai-text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.rida-ai-btn-icon:hover {
  background: var(--rida-ai-primary);
  color: #ffffff;
  border-color: var(--rida-ai-neon);
}

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

.rida-ai-messages::-webkit-scrollbar {
  width: 5px;
}
.rida-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 153, 255, 0.25);
  border-radius: 3px;
}

.rida-ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.55;
  animation: ridaAiFadeIn 0.22s ease-out;
}

@keyframes ridaAiFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.rida-ai-bubble {
  padding: 12px 15px;
  border-radius: 12px;
  word-break: break-word;
}

.rida-ai-msg.bot .rida-ai-bubble {
  background: var(--rida-ai-bubble-bot);
  border: 1px solid var(--rida-ai-border);
  color: var(--rida-ai-text);
  border-bottom-left-radius: 3px;
}

.rida-ai-msg.user .rida-ai-bubble {
  background: var(--rida-ai-bubble-user);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
}

.rida-ai-bubble p { margin: 0 0 8px; }
.rida-ai-bubble p:last-child { margin-bottom: 0; }
.rida-ai-bubble strong { color: var(--rida-ai-neon); font-weight: 700; }
.rida-ai-bubble code { font-family: 'JetBrains Mono', monospace; background: rgba(0,0,0,0.3); padding: 2px 5px; border-radius: 3px; font-size: 12px; }

/* Rich Cards & Demos Container */
.rida-ai-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.rida-ai-card {
  background: var(--rida-ai-card-bg);
  border: 1px solid var(--rida-ai-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.rida-ai-card:hover {
  border-color: var(--rida-ai-neon);
}

.rida-ai-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--rida-ai-text);
  margin-bottom: 4px;
}

.rida-ai-card-desc {
  font-size: 12px;
  color: var(--rida-ai-text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.rida-ai-card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rida-ai-card-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--rida-ai-neon);
}

.rida-ai-card-actions {
  display: flex;
  gap: 6px;
}

.rida-ai-card-btn {
  flex: 1;
  text-align: center;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.rida-ai-card-btn.primary {
  background: var(--rida-ai-primary);
  color: #fff;
}
.rida-ai-card-btn.primary:hover {
  background: #005ce6;
  box-shadow: 0 0 10px rgba(0, 119, 255, 0.5);
}

.rida-ai-card-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--rida-ai-border);
  color: var(--rida-ai-neon);
}
.rida-ai-card-btn.ghost:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: var(--rida-ai-neon);
}

/* Interactive Order Summary Box */
.rida-ai-order-summary {
  background: rgba(0, 119, 255, 0.08);
  border: 1px dashed var(--rida-ai-neon);
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
  font-size: 12.5px;
}

.rida-ai-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rida-ai-summary-row:last-child {
  border-bottom: none;
  font-weight: 700;
  color: var(--rida-ai-neon);
  margin-top: 4px;
}

/* Quick Action Chips */
.rida-ai-quick-actions {
  padding: 8px 16px 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.rida-ai-quick-actions::-webkit-scrollbar { display: none; }

.rida-ai-chip {
  background: rgba(0, 153, 255, 0.1);
  border: 1px solid rgba(0, 153, 255, 0.35);
  color: var(--rida-ai-neon);
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.rida-ai-chip:hover {
  background: var(--rida-ai-primary);
  color: #ffffff;
  border-color: var(--rida-ai-neon);
  box-shadow: 0 0 10px var(--rida-ai-neon-glow);
}

/* Typing Indicator */
.rida-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--rida-ai-bubble-bot);
  border: 1px solid var(--rida-ai-border);
  border-radius: 12px;
  width: fit-content;
  margin-left: 16px;
  margin-bottom: 8px;
}

.rida-ai-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--rida-ai-neon);
  border-radius: 50%;
  animation: ridaAiBounce 1.2s infinite ease-in-out;
}

.rida-ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.rida-ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ridaAiBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Chat Input Bar */
.rida-ai-footer {
  padding: 12px 14px;
  background: rgba(16, 23, 38, 0.98);
  border-top: 1px solid var(--rida-ai-border);
}

.rida-ai-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 16, 27, 0.8);
  border: 1px solid var(--rida-ai-border);
  border-radius: 10px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s;
}

.rida-ai-form:focus-within {
  border-color: var(--rida-ai-neon);
  box-shadow: 0 0 10px rgba(0, 153, 255, 0.25);
}

.rida-ai-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--rida-ai-text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  padding: 8px 0;
}

.rida-ai-input::placeholder {
  color: rgba(245, 247, 250, 0.4);
}

.rida-ai-send-btn {
  background: linear-gradient(135deg, #0077FF, #00D2FF);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.rida-ai-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 12px var(--rida-ai-neon);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .rida-ai-launcher {
    bottom: 18px;
    right: 18px;
    width: 54px;
    height: 54px;
  }
  .rida-ai-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}
