/* ── Nexora Chatbot Widget ── Mid-Hudson Web Brand Colors ── */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --nexora-primary: #e8637a;
  --nexora-primary-dk: #d4486a;
  --nexora-accent: #f4a06a;
  --nexora-gradient: linear-gradient(160deg, #f9c5d8 0%, #f8a4c0 25%, #f5b87a 70%, #f4c87a 100%);
  --nexora-dark: #f8fafc;
  --nexora-dark2: #ffffff;
  --nexora-white: #ffffff;
  --nexora-light: #f1f5f9;
  --nexora-grey: #64748b;
  --nexora-text: #334155;
  --nexora-radius: 20px;
  --nexora-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

/* ── Force consistent Poppins font — prevents any WordPress theme from overriding ── */
#nexora-launcher,
#nexora-launcher *,
#nexora-window,
#nexora-window * {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  box-sizing: border-box;
}

/* ── Launcher Bubble ── */
#nexora-launcher {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nexora-primary), var(--nexora-accent));
  box-shadow: 0 8px 24px rgba(232, 99, 122, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  border: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Pass all clicks/taps through inner bot elements straight to the button */
#nexora-launcher * {
  pointer-events: none;
}

#nexora-launcher:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 12px 28px rgba(232, 99, 122, 0.5);
}

#nexora-launcher svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  pointer-events: none;
}

#nexora-launcher .nexora-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  border: 3px solid #fff;
  display: none;
  pointer-events: none;
}

#nexora-launcher .nexora-badge.show {
  display: block;
}

/* ── Chat Window ── */
#nexora-window {
  position: fixed;
  bottom: 180px;
  right: 30px;
  width: 380px;
  max-height: calc(100vh - 220px);
  height: 80vh;
  background: #ffffff;
  border-radius: var(--nexora-radius);
  box-shadow: var(--nexora-shadow);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

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

/* ── Header ── */
#nexora-header {
  background: var(--nexora-gradient);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.nexora-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nexora-header-info {
  flex: 1;
}

.nexora-header-info strong {
  display: block;
  color: #000000;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}

.nexora-header-info span {
  color: rgba(0, 0, 0, 0.85);
  font-size: 13px;
  font-weight: 400;
  display: flex;
  align-items: center;
}

.nexora-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

#nexora-close,
#nexora-restart {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#nexora-close:hover,
#nexora-restart:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

#nexora-restart:hover {
  transform: rotate(45deg);
}

/* ── Messages Area ── */
#nexora-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background: #f8fafc;
}

#nexora-messages::-webkit-scrollbar {
  width: 6px;
}

#nexora-messages::-webkit-scrollbar-track {
  background: transparent;
}

#nexora-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

#nexora-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── Welcome Card ── */
.nexora-welcome-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 4px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  animation: djFadeInUp 0.3s ease forwards;
}

.nexora-welcome-logo {
  font-size: 28px;
  margin-bottom: 2px;
  line-height: 1;
}

.nexora-welcome-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.nexora-welcome-card p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* ── Bubbles ── */
.nexora-msg,
.raj-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: djFadeInUp 0.3s ease forwards;
}

@keyframes djFadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nexora-msg.nexora-bot,
.raj-msg.raj-bot {
  justify-content: flex-start;
}

.nexora-msg.nexora-user,
.raj-msg.raj-user {
  justify-content: flex-end;
}

.nexora-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.nexora-bubble-wrapper-user {
  align-items: flex-end;
}

.nexora-msg-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  margin-left: 4px;
  margin-right: 4px;
}

.nexora-bubble,
.raj-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nexora-bot .nexora-bubble,
.raj-bot .raj-bubble {
  background: #ffffff;
  color: var(--nexora-text);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.nexora-user .nexora-bubble,
.raj-user .raj-bubble {
  background: linear-gradient(135deg, var(--nexora-primary), var(--nexora-primary-dk));
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* ── Markdown Styles ── */
.nexora-bubble strong {
  font-weight: 600;
}

.nexora-bubble em {
  font-style: italic;
}

.nexora-bubble a {
  color: inherit;
  text-decoration: underline;
}

.nexora-bubble ul {
  margin: 6px 0;
  padding-left: 20px;
}

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

.nexora-bubble p {
  margin: 0 0 8px 0;
}

.nexora-bubble p:last-child {
  margin: 0;
}

/* ── Quick Buttons ── */
.nexora-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px 16px;
  background: transparent;
}

.nexora-quick-btn {
  background: var(--nexora-gradient);
  border: none;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(248, 164, 192, 0.2);
}

.nexora-quick-btn:hover {
  opacity: 0.9;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248, 164, 192, 0.4);
}

/* ── Typing Indicator ── */
.nexora-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.nexora-typing span:nth-child(1) {
  animation-delay: 0s;
}

.nexora-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.nexora-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes djTypingPulse {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Lead Form ── */
#nexora-lead-form {
  padding: 20px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
  display: none;
}

#nexora-lead-form.show {
  display: block;
  animation: djFadeInUp 0.3s ease forwards;
}

#nexora-lead-form p {
  color: var(--nexora-grey);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.4;
}

.nexora-field {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: var(--nexora-text);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nexora-field:focus {
  outline: none;
  border-color: var(--nexora-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(232, 99, 122, 0.1);
}

.nexora-field::placeholder {
  color: #94a3b8;
}

.nexora-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--nexora-primary), var(--nexora-primary-dk));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.nexora-submit:hover {
  opacity: 0.95;
  box-shadow: 0 4px 12px rgba(232, 99, 122, 0.2);
  transform: translateY(-1px);
}

/* ── Input Bar ── */
#nexora-input-bar {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  z-index: 2;
}

#nexora-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  color: var(--nexora-text);
  padding: 10px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
}

#nexora-input:focus {
  border-color: var(--nexora-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(232, 99, 122, 0.1);
}

#nexora-input::placeholder {
  color: #94a3b8;
}

#nexora-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nexora-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(232, 99, 122, 0.2);
}

#nexora-send:hover {
  background: var(--nexora-primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 99, 122, 0.3);
}

#nexora-send svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  margin-left: 2px;
}

/* ── Thank You ── */
#nexora-thankyou {
  padding: 40px 30px;
  text-align: center;
  display: none;
  background: #ffffff;
  flex: 1;
}

#nexora-thankyou.show {
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: djFadeInUp 0.3s ease forwards;
}

#nexora-thankyou .nexora-ty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

#nexora-thankyou h3 {
  color: #0f172a;
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

#nexora-thankyou p {
  color: var(--nexora-grey);
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #nexora-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    right: 16px;
    bottom: 96px;
  }

  #nexora-launcher {
    right: 16px;
    bottom: 16px;
  }
}

/* ── 3D Animated Bot ── */
.nexora-animated-bot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
  background-size: 300% 300%;
  animation: dj-gradient-move 4s ease infinite;
  box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.2), inset 5px 5px 15px rgba(255, 255, 255, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#nexora-launcher .nexora-animated-bot {
  width: 64px;
  height: 64px;
}

.nexora-avatar .nexora-animated-bot {
  width: 40px;
  height: 40px;
  box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.2), inset 3px 3px 8px rgba(255, 255, 255, 0.4);
}

@keyframes dj-gradient-move {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.nexora-bot-face {
  position: relative;
  width: 60%;
  height: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* Eyes */
.nexora-bot-eyes {
  display: flex;
  gap: 8px;
  animation: dj-eye-move 6s infinite;
}

.nexora-avatar .nexora-bot-eyes {
  gap: 5px;
}

.nexora-bot-eye {
  width: 8px;
  height: 12px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  animation: dj-blink 4s infinite;
}

.nexora-avatar .nexora-bot-eye {
  width: 5px;
  height: 8px;
}

/* Eye movement (looking around) */
@keyframes dj-eye-move {

  0%,
  10% {
    transform: translate(0, 0);
  }

  15%,
  25% {
    transform: translate(-4px, 0);
  }

  30%,
  40% {
    transform: translate(4px, -2px);
  }

  45%,
  55% {
    transform: translate(0, 4px);
  }

  60%,
  100% {
    transform: translate(0, 0);
  }
}

/* Blinking */
@keyframes dj-blink {

  0%,
  96% {
    transform: scaleY(1);
  }

  98% {
    transform: scaleY(0.1);
  }

  100% {
    transform: scaleY(1);
  }
}

/* Happy Smile */
.nexora-bot-smile {
  margin-top: 6px;
  width: 14px;
  height: 6px;
  border-bottom: 3px solid white;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.4);
  animation: dj-eye-move 6s infinite;
}

.nexora-avatar .nexora-bot-smile {
  margin-top: 4px;
  width: 10px;
  height: 4px;
  border-bottom: 2px solid white;
}

/* ── Quick Button Theme Override (fixes conflicts with external themes) ── */
#nexora-window .nexora-quick-btns {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 16px 20px 16px !important;
}

#nexora-window .nexora-quick-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  padding: 8px 14px !important;
  border-radius: 20px !important;
  margin: 0 !important;
  background: var(--nexora-gradient) !important;
  color: #000000 !important;
  border: none !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 4px rgba(248, 164, 192, 0.2) !important;
  cursor: pointer !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

#nexora-window .nexora-quick-btn:hover {
  opacity: 0.9 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(248, 164, 192, 0.4) !important;
}

/* ── Submit Button Theme Override (fixes conflicts with external themes) ── */
#nexora-window .nexora-submit {
  width: 100% !important;
  background: linear-gradient(135deg, #e8637a, #d4486a) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 14px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  margin-top: 4px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
  display: block !important;
  line-height: normal !important;
  outline: none !important;
}

#nexora-window .nexora-submit:hover {
  opacity: 0.95 !important;
  box-shadow: 0 4px 12px rgba(232, 99, 122, 0.2) !important;
  transform: translateY(-1px) !important;
}