/**
 * Chat Widget CSS Modules Stylesheet
 * 
 * Modern pink/purple theme matching Contend brand design
 * Provides scoped styling for the chat widget component
 */

/* Widget Container */
.Widget-module__widget___lvriq {
  position: absolute;
  inset: 0;

  /* width: 100%;
  height: 100%; */

  display: flex;
  flex-direction: column;

  /* text */
  font-family:
    Noto Sans,
    sans-serif;
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 400;

  border-radius: 1.875rem; /* 30px */
  overflow: hidden;
  box-shadow: var(--contend-shadow-flat);
}

/* Header */
.Widget-module__header___WyvgB {
  flex-shrink: 0;
  padding: 20px;
  background-color: #f365b4;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.Widget-module__headerContent___S2GKg {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.Widget-module__avatar___SX8zH {
  width: 60px;
  height: 60px;
  flex: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.Widget-module__headerText___BPzXi {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.Widget-module__title___MrYnJ {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.875rem;
  font-weight: 600;
  color: white;
}

.Widget-module__subtitle___BxeYP {
  margin: 0 !important;
}

/* Messages Container */
.Widget-module__messagesContainer___nnmiL {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: var(--contend-steam, #f5f5fc);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#my-nextjs-widget-root.contend-chat-widget-homepage
  .Widget-module__messagesContainer___nnmiL {
  background-color: white;
}

/* Assistant Info */
.Widget-module__assistantInfo___Bg8FF {
  margin-bottom: 8px;
}

.Widget-module__assistantName___nt7pX {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.Widget-module__welcomeMessage___lOVSw {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 8px;
}

.Widget-module__welcomeMessage___lOVSw p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #1f2937;
  font-weight: 400;
}

/* Messages */
.Widget-module__message___szSjP {
  flex-shrink: 0;
  display: flex;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
  animation: Widget-module__fadeIn___T4zyz 0.3s ease-in;
}

@keyframes Widget-module__fadeIn___T4zyz {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.Widget-module__messageUser___cGRhx {
  align-self: flex-end;
  margin-left: auto;
  border-radius: 20px 20px 0 20px;
  background-color: #4646c8;
  color: white;
}

.Widget-module__messageBot___MgBQm {
  align-self: flex-start;
  border-radius: 20px 20px 20px 0;
  background-color: white;
  color: #09095b;
}

.Widget-module__messageContent___giPtn {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.Widget-module__messageText___hrPL7 {
  padding: 20px;
  word-wrap: break-word;
}

.Widget-module__messageText___hrPL7 p {
  margin: 0;
}

/* Status Update */
.Widget-module__statusUpdate___QpDKC {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  animation: Widget-module__slideIn___EjxWB 0.3s ease-in;
}

@keyframes Widget-module__slideIn___EjxWB {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.Widget-module__statusIcon___MDnZ6 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.Widget-module__statusText___UHqJr {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #047857;
}

.Widget-module__viewUpdateButton___HQkhZ {
  padding: 6px 12px;
  background: transparent;
  color: #10b981;
  border: 1px solid #10b981;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.Widget-module__viewUpdateButton___HQkhZ:hover {
  background: #10b981;
  color: white;
}

/* Typing Indicator */
.Widget-module__typingIndicator___B6AcW {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #f3f4f6;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
}

.Widget-module__typingIndicator___B6AcW span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: Widget-module__typing___QP6Q5 1.4s infinite;
}

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

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

@keyframes Widget-module__typing___QP6Q5 {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Full Screen Banner */
.Widget-module__fullScreenBanner___Agf7W {
  position: relative;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f365b4 0%, #e855a4 100%);
  animation: Widget-module__slideUp___ddRUz 0.3s ease-out;
  margin: 0;
}

@keyframes Widget-module__slideUp___ddRUz {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.Widget-module__fullScreenBannerClose___pjfkG {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.Widget-module__fullScreenBannerClose___pjfkG:hover {
  background: rgba(255, 255, 255, 0.3);
}

.Widget-module__fullScreenBannerContent___uDuVZ {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.Widget-module__fullScreenBannerText___Q7Wk9 {
  color: white;
  font-size: var(--contend-font-size-caption, 14px);
  font-weight: 400;
}

.Widget-module__fullScreenBannerButton___W60b7 {
  padding: 8px 16px !important;
  background: white !important;
  color: var(--contend-electric-purple, #4646c8) !important;
  border: none !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.25s !important;
  white-space: nowrap !important;
}

.Widget-module__fullScreenBannerButton___W60b7:hover {
  background: var(--contend-electric-purple, #4646c8) !important;
  color: white !important;
}

.Widget-module__fullScreenBannerButton___W60b7:active {
  transform: scale(0.98);
}

/* Solution Card Styles */
.Widget-module__solutionCard___y8aoJ {
  background-color: white;
  border-radius: 1.25rem; /* 20px */
  padding: 1.25rem; /* 20px */
  margin-top: 1.25rem; /* 20px */
  margin-left: auto;
  margin-right: auto;
  max-width: 310px;
  display: flex;
  flex-direction: column;
  gap: 1.875rem; /* 30px */
  box-shadow: var(--contend-shadow-soft);
}

.Widget-module__solutionCardContent___JLsYk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem; /* 10px */
  text-align: center;
}

.Widget-module__solutionCardList___iHvtp {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem; /* 10px */
}

.Widget-module__solutionCardListItemIcon___NLJMp {
  flex: 0;
}

.Widget-module__solutionCardListItem___PNtpC {
  display: flex;
  align-items: flex-start;
  text-align: left;
  gap: 0.625rem; /* 10px */
  font: var(--contend-font-body-regular, 400 1rem/1.5rem Noto Sans, sans-serif);
  color: var(--contend-midnight, #09095b);
}

/* Input Form */
.Widget-module__inputForm___HDr1g {
  flex-shrink: 0;
  padding: 20px;
  background-color: #dedef7;
  margin: 0;
}

.Widget-module__inputWrapper___VX5o4 {
  display: flex;
  align-items: end;
  gap: 8px;
  background: white;
  border-radius: 20px;
  padding: 10px;
}

.Widget-module__input___KRplB {
  flex: 1;
  height: 100%;
  min-height: 100px;
  border: none !important;
  outline: none !important;
  padding: 10px !important;
  color: #09095b !important;

  /* wrap text and allow scrolling when content overflows */
  font-family:
    Noto Sans,
    sans-serif;
  font-size: inherit;
  overflow: auto !important;
  resize: none !important;
  white-space: pre-wrap !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

.Widget-module__input___KRplB::-moz-placeholder {
  color: #b6b6de;
}

.Widget-module__input___KRplB::placeholder {
  color: #b6b6de;
}

.Widget-module__input___KRplB:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error message */
.Widget-module__errorMessage___QmEzB {
  margin: 8px 16px;
  padding: 8px 12px;
  background-color: #fee2e2;
  color: #dc2626;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

/* Loading message */
.Widget-module__loadingMessage___DJNbq {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.Widget-module__loadingDots___Jmjv6 {
  display: flex;
  gap: 4px;
}

.Widget-module__loadingDots___Jmjv6 span {
  width: 8px;
  height: 8px;
  background-color: #f365b4;
  border-radius: 50%;
  animation: Widget-module__loadingPulse___kOjDh 1.4s ease-in-out infinite;
}

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

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

@keyframes Widget-module__loadingPulse___kOjDh {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Message header for assistant */
.Widget-module__messageHeader___H_4RS {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.Widget-module__messageAvatar___K0g5_ {
  width: 24px;
  height: 24px;
}

.Widget-module__messageName___crAji {
  font-weight: 600;
  color: #4b5563;
  font-size: 14px;
}

.Widget-module__voiceButton___Uqbz2 {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.Widget-module__voiceButton___Uqbz2:hover:not(:disabled) {
  opacity: 0.7;
}

.Widget-module__voiceButton___Uqbz2:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.Widget-module__sendButton___ClPkS {
  width: 36px !important;
  height: 36px !important;
  padding: 8px !important;
  background-color: #f365b4 !important;
  color: white !important;
  border: none !important;
  border-radius: 100px !important;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s !important;
}

.Widget-module__sendButton___ClPkS:hover:not(:disabled) {
  background-color: #e151a1 !important;
  transform: scale(1.05) !important;
}

.Widget-module__sendButton___ClPkS:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(243, 101, 180, 0.4) !important;
}

.Widget-module__sendButton___ClPkS:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Scrollbar Styling */
.Widget-module__messagesContainer___nnmiL::-webkit-scrollbar {
  width: 6px;
}

.Widget-module__messagesContainer___nnmiL::-webkit-scrollbar-track {
  background: transparent;
}

.Widget-module__messagesContainer___nnmiL::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}

.Widget-module__messagesContainer___nnmiL::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}

/* Prevent Overscrolling onto the main page: */
/* 1) The inner scroll area controls its own scroll only */
.Widget-module__widget___lvriq .Widget-module__messagesContainer___nnmiL {
  overflow-y: auto;
  overscroll-behavior-y: contain; /* no chaining to page */
  -webkit-overflow-scrolling: touch; /* smoother on iOS */
}

/* 2) Desktop: when the pointer is over the child, lock page scroll */
@supports selector(:has(*)) {
  @media (hover: hover) and (pointer: fine) {
    body:has(.Widget-module__widget___lvriq:is(:hover, :focus-within)) {
      overflow: hidden; /* page won't scroll */
      overscroll-behavior: none; /* extra safety */
    }
  }
}

/* --- Close Button + Minimization: --- */
.Widget-module__closeButton___L8KEs {
  /* Hide on desktop: */
  display: none !important;
}

/* Mobile / Tablet Responsiveness: */
@media (max-width: 1024px) {
  .Widget-module__closeButton___L8KEs {
    display: block !important;
    flex-shrink: 0 !important;
    width: 30px !important;
    height: 30px !important;
    background-color: #e151a1 !important;
    border-radius: 100% !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: opacity 0.25s !important;
  }

  .Widget-module__closeButton___L8KEs:hover {
    opacity: 0.8 !important;
  }

  .Widget-module__closeButton___L8KEs svg {
    display: block !important;
    fill: white !important;
    margin: 0 auto !important;
  }

  .Widget-module__widget___lvriq {
    position: fixed !important;
    inset: unset !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 80vh !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
  }

  .Widget-module__widgetMinimized___PY5XG {
    height: auto !important; /* Height is now based on the header content */
    cursor: pointer !important;
    overflow: hidden !important;
  }

  .Widget-module__widgetMinimized___PY5XG .Widget-module__header___WyvgB {
    transition: background-color 0.25s !important;
  }

  .Widget-module__widgetMinimized___PY5XG:hover .Widget-module__header___WyvgB {
    background-color: #e151a1 !important;
  }

  /* Hide these sections when the widget is minimized */
  .Widget-module__widgetMinimized___PY5XG .Widget-module__messagesContainer___nnmiL,
  .Widget-module__widgetMinimized___PY5XG .Widget-module__inputForm___HDr1g,
  .Widget-module__widgetMinimized___PY5XG .Widget-module__fullScreenBanner___Agf7W {
    display: none !important;
  }

  /* Hide the dedicated close button when minimized */
  .Widget-module__widgetMinimized___PY5XG .Widget-module__closeButton___L8KEs {
    display: none !important;
  }

  .contend-widget-container--minimized {
    /* Effectively make the container invisible and shrink it */
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    /* Allow clicks to pass through the now-invisible container */
    pointer-events: none !important;
  }
  /* Re-enable pointer events for the actual visible widget part */
  .contend-widget-container--minimized > div {
    pointer-events: auto !important;
  }
}

/* TODO: Do we need these items below? Do they need to be made consistent with the updated designs? */
/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .Widget-module__widget___lvriq {
    border: 2px solid #000;
  }

  .Widget-module__messageBot___MgBQm .Widget-module__messageText___hrPL7 {
    border: 2px solid #000;
  }

  .Widget-module__messageUser___cGRhx .Widget-module__messageText___hrPL7 {
    border: 2px solid #fff;
  }

  .Widget-module__inputWrapper___VX5o4 {
    border: 2px solid #000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .Widget-module__message___szSjP,
  .Widget-module__statusUpdate___QpDKC,
  .Widget-module__typingIndicator___B6AcW span {
    animation: none;
  }

  .Widget-module__minimized___Z3OVw:hover {
    transform: none;
  }

  .Widget-module__sendButton___ClPkS:hover:not(:disabled) {
    transform: none;
  }
}


/*# sourceMappingURL=widget.css.map*/