/**
 * @file
 * ConversionBox AI Chat Widget Styles - Iframe Architecture
 */

/* Parent container */
#cbParentFrame {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

/* Widget wrapper: collapsed by default so it takes no space when chat is closed or on page load */
#cbWidgetWrapper {
  position: absolute;
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  /* pointer-events: none; */
  bottom: 112px;
  right: 0;
}

/* Legal information disclaimer on first bot response: one blank line above, italic text, link */
.cb-legal-disclaimer {
  margin-top: 1em;
  font-size: 0.9em;
  color: #555;
}
.cb-legal-disclaimer em {
  font-style: italic;
}

/* Bold all hyperlinks in chat messages */
.cb-conv-msg-text a,
.cb-conv-msg-text .innerMsgLink {
  font-weight: bold;
}

/* Base iframe styles — no max-width cap (theme/layout often sets iframe { max-width: 100% }) */
.cb-iframe,
#cbChatToggleFrame,
#cbChatTriggerFrame,
#cbChatWidgetFrame {
  max-width: none;
}

.cb-iframe {
  border: none;
  background: transparent;
  overflow: visible;
}

/* Toggle iframe — matches RVEC / newchatscript.js (~74×104) */
#cbChatToggleFrame {
  width: 74px;
  height: 104px;
  position: relative;
  z-index: 1;
}

/* Trigger/Flypopup iframe */
#cbChatTriggerFrame {
  position: absolute;
  bottom: 112px;
  right: 0;
  width: 320px;
  height: 120px;
  z-index: 2;
  pointer-events: auto;
}

/* Widget iframe */
#cbChatWidgetFrame {
  position: absolute;
  bottom: 112px;
  right: 0;
  width: 380px;
  height: 600px;
  z-index: 3;
}

/* Left position support */
#cbParentFrame.cb-position-left #cbWidgetWrapper {
  right: auto;
  left: 0;
}
#cbParentFrame.cb-position-left #cbChatTriggerFrame,
#cbParentFrame.cb-position-left #cbChatWidgetFrame {
  right: auto;
  left: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  /* #cbChatWidgetFrame {
    width: calc(100vw - 32px) !important;
    max-width: 380px;
    right: -16px !important;
  } */

  #cbChatTriggerFrame {
    width: calc(100vw - 100px);
    max-width: none;
  }

  #cbParentFrame {
    right: 16px !important;
    bottom: 16px !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #cbChatToggleFrame,
  #cbChatTriggerFrame,
  #cbChatWidgetFrame {
    outline: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cb-iframe * {
    animation: none !important;
    transition: none !important;
  }
}
