/* ==========================================================================
   Nuzznext Modern Interactive Floating Chatbot CSS
   ========================================================================== */

:root {
  --nn-bot-primary: #e45b12;
  --nn-bot-primary-dark: #c84a09;
  --nn-bot-gradient: linear-gradient(135deg, #f36f21 0%, #d94e09 100%);
  --nn-bot-bg-gradient: linear-gradient(145deg, #ffffff 0%, #fff7f2 55%, #ffebe0 100%);
  --nn-bot-shadow: 0 16px 36px -6px rgba(228, 91, 18, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
  --nn-bot-text-dark: #1e293b;
  --nn-bot-text-muted: #64748b;
  --nn-bot-border: rgba(243, 111, 33, 0.2);
}

/* Base Widget Container (Positioned Bottom Left) */
#nuzznext-chatbot-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 999999;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Floating Launcher Button - Clean Round Avatar */
.nn-bot-launcher {
  position: relative;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(228, 91, 18, 0.35), 0 0 0 3px rgba(228, 91, 18, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3.5px solid #e45b12;
  overflow: visible;
  padding: 2px;
}

.nn-bot-launcher:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 14px 35px rgba(228, 91, 18, 0.45), 0 0 0 5px rgba(228, 91, 18, 0.2);
}

.nn-bot-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Concentric Ripple Wave Animation (Image style) */
.nn-bot-ripple {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 2.5px solid var(--nn-bot-primary);
  animation: nn-ripple 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  pointer-events: none;
}

@keyframes nn-ripple {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { opacity: 0.4; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Greeting Speech Bubble Pill */
.nn-bot-greeting-pill {
  position: absolute;
  left: 78px;
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  animation: nn-fade-in-left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  z-index: 10;
}

.nn-bot-greeting-pill strong {
  color: #f36f21;
}

.nn-bot-greeting-pill::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 7px 6px 0;
  border-style: solid;
  border-color: transparent #111827 transparent transparent;
}

@keyframes nn-fade-in-left {
  from { opacity: 0; transform: translateY(-50%) translateX(-10px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.nn-bot-badge {
  display: none !important;
}

@keyframes nn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Preview Modal Card */
.nn-bot-preview-card {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: auto;
  width: 340px;
  background: var(--nn-bot-bg-gradient);
  border-radius: 28px;
  padding: 55px 20px 20px 20px;
  box-shadow: var(--nn-bot-shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: nn-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
}

.nn-bot-preview-mascot {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
  animation: nn-float 4s ease-in-out infinite;
}

@keyframes nn-float {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50% { transform: translateX(-50%) translateY(-7px); }
}

/* Top control buttons on preview card */
.nn-bot-preview-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nn-bot-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.6);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nn-bot-icon-btn:hover {
  background: #ffffff;
  color: var(--nn-bot-primary);
  transform: scale(1.06);
}

.nn-bot-preview-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.nn-bot-suggestion-bubble {
  background: #ffffff;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: #1e293b;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.nn-bot-suggestion-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
  border-color: var(--nn-bot-primary);
  color: var(--nn-bot-primary);
}

.nn-bot-suggestion-bubble strong {
  color: var(--nn-bot-primary);
  display: block;
}

.nn-bot-preview-input-trigger {
  margin-top: 8px;
  background: #ffffff;
  border: 2.5px solid #2563eb;
  border-radius: 20px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
  transition: all 0.2s ease;
}

.nn-bot-preview-input-trigger span {
  color: #94a3b8;
  font-size: 14px;
}

.nn-bot-preview-input-trigger svg {
  color: var(--nn-bot-primary);
  width: 20px;
  height: 20px;
}

/* Full Active Chat Window (Matching Image 1 & 3) */
.nn-bot-chat-window {
  position: absolute;
  bottom: 0;
  left: 0;
  right: auto;
  width: 380px;
  height: 590px;
  max-height: calc(100vh - 40px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--nn-bot-shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: nn-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
}

.nn-bot-chat-window.fullscreen {
  width: 440px;
  height: 680px;
}

@keyframes nn-slide-up {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header */
.nn-bot-header {
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

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

.nn-bot-avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7f2 0%, #ffebe0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e45b12;
  box-shadow: 0 4px 10px rgba(228, 91, 18, 0.25);
  overflow: hidden;
}

.nn-bot-avatar-wrapper img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nn-bot-header-info {
  display: flex;
  flex-direction: column;
}

.nn-bot-header-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.nn-bot-header-status {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.nn-bot-status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
}

.nn-bot-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Overflow Menu Popover (Matching Image 3) */
.nn-bot-popover-menu {
  position: absolute;
  top: 60px;
  left: 14px;
  background: #ffffff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  width: 210px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: nn-fade-in 0.2s ease;
}

@keyframes nn-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nn-bot-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nn-bot-menu-item:hover {
  background: #f8fafc;
}

.nn-bot-menu-item.danger {
  color: #ef4444;
}

.nn-bot-menu-item.danger:hover {
  background: #fef2f2;
}

.nn-bot-menu-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nn-bot-menu-icon.whatsapp { background: #dcfce7; color: #16a34a; }
.nn-bot-menu-icon.phone { background: #fce7f3; color: #db2777; }
.nn-bot-menu-icon.clear { background: #f1f5f9; color: #64748b; }
.nn-bot-menu-icon.min { background: #f1f5f9; color: #64748b; }
.nn-bot-menu-icon.end { background: #fee2e2; color: #ef4444; }

/* Messages Area */
.nn-bot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.nn-bot-msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 86%;
}

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

.nn-bot-msg-row.user {
  align-self: flex-end;
}

.nn-bot-author-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--nn-bot-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.nn-bot-author-tag img {
  width: 18px;
  height: 18px;
}

.nn-bot-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

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

.nn-bot-msg-row.user .nn-bot-msg-bubble {
  background: var(--nn-bot-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nn-bot-timestamp {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.nn-bot-msg-row.user .nn-bot-timestamp {
  text-align: right;
  color: rgba(255,255,255,0.8);
}

/* Service Options Grid / Chips (Matching Image 3) */
.nn-bot-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.nn-bot-option-chip {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.nn-bot-option-chip:hover {
  border-color: var(--nn-bot-primary);
  color: var(--nn-bot-primary);
  background: #eff6ff;
}

.nn-bot-option-chip.selected {
  background: #eff6ff;
  border-color: var(--nn-bot-primary);
  color: var(--nn-bot-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Continue Button */
.nn-bot-continue-btn {
  grid-column: span 2;
  margin-top: 6px;
  background: var(--nn-bot-gradient);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.nn-bot-continue-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* Bottom Input Bar */
.nn-bot-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nn-bot-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 28px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s ease;
}

.nn-bot-input-form:focus-within {
  border-color: var(--nn-bot-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

.nn-bot-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  padding: 8px 0;
}

.nn-bot-input::placeholder {
  color: #94a3b8;
}

.nn-bot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nn-bot-gradient);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.nn-bot-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

.nn-bot-send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.nn-bot-branding {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nn-bot-branding strong {
  color: var(--nn-bot-primary);
}

/* Typing Indicator */
.nn-bot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
  width: fit-content;
}

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

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

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

/* Mobile Responsiveness & Adaptive Touch Layouts */
@media (max-width: 768px) {
  #nuzznext-chatbot-widget {
    bottom: 16px;
    left: 16px;
    right: auto;
  }

  .nn-bot-launcher {
    width: 58px;
    height: 58px;
  }

  .nn-bot-greeting-pill {
    left: 70px;
    max-width: calc(100vw - 110px);
    font-size: 12px;
    padding: 8px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nn-bot-chat-window {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: auto;
    width: calc(100vw - 24px);
    max-width: 380px;
    height: calc(100vh - 90px);
    max-height: 560px;
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  }

  .nn-bot-preview-card {
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: auto;
    width: calc(100vw - 24px);
    max-width: 350px;
    border-radius: 22px;
  }

  .nn-bot-options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .nn-bot-option-chip {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 40px;
  }

  .nn-bot-header-title {
    font-size: 15px;
  }

  .nn-bot-input {
    font-size: 13.5px;
  }
}

@media (max-width: 400px) {
  .nn-bot-options-grid {
    grid-template-columns: 1fr;
  }

  .nn-bot-greeting-pill {
    font-size: 11px;
    padding: 7px 10px;
    left: 64px;
    max-width: calc(100vw - 95px);
  }
}
