/* Nova Chat Mobile Modal Fix */
/* Fixes z-index and positioning issues on mobile devices */

/* Nova overlay - ensure highest z-index */
#nova-quote-overlay {
  z-index: 9999999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* Nova card - proper positioning on mobile */
.nova-quote-card {
  z-index: 10000000 !important;
  position: fixed !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
  #nova-quote-overlay {
    z-index: 9999999 !important;
  }
  
  .nova-quote-card {
    z-index: 10000000 !important;
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
  }
  
  /* Ensure send button is always visible */
  .nova-quote-send,
  .nova-quote-send-step0,
  .nova-quote-send-step1,
  .nova-quote-send-step2 {
    z-index: 10000001 !important;
    position: relative !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Chat input bar - ensure proper positioning */
  .nova-quote-chat-bar {
    z-index: 10000001 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid #e0e0e0 !important;
  }
  
  /* Chat input field */
  .nova-quote-chat-input {
    flex: 1 !important;
    min-width: 0 !important;
    z-index: 10000001 !important;
    position: relative !important;
  }
  
  /* Send button specifically */
  .nova-quote-send.js-nova-send-step0 {
    z-index: 10000002 !important;
    position: relative !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    background: #0b7a3d !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Ensure button is clickable */
  .nova-quote-send.js-nova-send-step0:hover,
  .nova-quote-send.js-nova-send-step0:focus {
    background: #096835 !important;
    outline: 2px solid #0b7a3d !important;
    outline-offset: 2px !important;
  }
  
  /* Chat compose area */
  .nova-chat-compose {
    z-index: 10000001 !important;
    position: relative !important;
    margin-top: auto !important;
  }
  
  /* Chat thread area */
  .nova-chat-thread {
    z-index: 1 !important;
    position: relative !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Step containers */
  .nova-quote-step {
    z-index: 2 !important;
    position: relative !important;
  }
  
  /* Action buttons */
  .nova-quote-actions,
  .nova-quote-btn {
    z-index: 10000001 !important;
    position: relative !important;
    pointer-events: auto !important;
  }
  
  /* Contact form actions */
  .nova-quiz-contact-actions {
    z-index: 10000001 !important;
    position: relative !important;
    padding: 16px 0 !important;
  }
  
  .nova-btn-continue.js-nova-contact-save {
    z-index: 10000002 !important;
    position: relative !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .nova-quote-card {
    width: 98vw !important;
    max-width: 98vw !important;
    max-height: 90vh !important;
  }
  
  .nova-quote-chat-bar {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px !important;
  }
  
  .nova-quote-chat-input {
    width: 100% !important;
  }
  
  .nova-quote-send.js-nova-send-step0 {
    width: 100% !important;
    text-align: center !important;
  }
}

/* Ensure backdrop doesn't interfere */
.nova-quote-backdrop {
  z-index: 9999998 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

/* Fix for any overlapping elements */
.nova-quote-body,
.nova-quote-content,
.nova-quote-step-content {
  z-index: 3 !important;
  position: relative !important;
}

/* Ensure all interactive elements are clickable */
.nova-quote-chip,
.nova-quote-select,
.nova-quote-field input,
.nova-quote-field textarea,
.nova-quote-field select {
  z-index: 10 !important;
  position: relative !important;
  pointer-events: auto !important;
}

/* Modal close button */
.nova-quote-close {
  z-index: 10000003 !important;
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Theme toggle — top-right beside close (not over the avatar on the left) */
.nova-quote-card--chat-dark .nova-theme-toggle,
.nova-theme-toggle {
  z-index: 10000003 !important;
  position: absolute !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(52px + env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
  width: 36px !important;
  height: 36px !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.nova-quote-card--chat-dark .nova-quote-close,
.nova-quote-close {
  z-index: 10000004 !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(10px + env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
}

.nova-chat-bubble--live-human {
  border-color: rgba(94, 234, 212, 0.45) !important;
  background: rgba(13, 148, 136, 0.22) !important;
}

.nova-chat-row--live-human .nova-chat-avatar-mini--human {
  background: rgba(94, 234, 212, 0.2) !important;
  color: #5eead4 !important;
}

.nova-live-human-label {
  margin: 0 0 6px !important;
  font-size: 12px !important;
}

.nova-chat-live-system {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: 10px 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.nova-quote-card.is-light .nova-chat-live-system {
  color: #646970;
  background: rgba(0, 0, 0, 0.04);
}

.nova-nudge-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 99999990;
  width: min(420px, calc(100vw - 24px));
  pointer-events: auto;
}

.nova-nudge-banner__inner {
  background: #0f172a;
  color: #e8eef7;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.nova-nudge-banner__title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #5eead4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nova-nudge-banner__text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
}

.nova-nudge-banner__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nova-nudge-banner__open {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #0b7a3d;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.nova-nudge-banner__dismiss {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.nova-push-optin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 199, 0.14), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(34, 211, 199, 0.35);
}

.nova-push-optin__text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #e2e8f0;
  flex: 1;
  min-width: 0;
}

.nova-push-optin__enable {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #0d9488, #7c3aed);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.nova-push-optin__enable:hover {
  filter: brightness(1.08);
}

.nova-push-optin__enable:focus-visible {
  outline: 2px solid rgba(34, 211, 199, 0.8);
  outline-offset: 2px;
}

.nova-push-optin__err {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #fecaca;
}
