/* n8n Chat for WordPress - frontend styles
 *
 * The chat widget itself is styled by the official @n8n/chat stylesheet.
 * These rules only handle the on-page (embedded / fullscreen) container so it
 * has a defined size for n8n's fullscreen mode to fill.
 */

.chatkit-embedded-wrapper {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  background: #fff;
  padding: 0;
  /* width/height are set inline from the shortcode atts */
}

/* The n8n fullscreen widget mounts into this element and fills it. */
.chatkit-embedded {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  margin: 0;
}

/* n8n fullscreen mode reads these to fill the available space. */
.chatkit-embedded .n8n-chat {
  width: 100%;
  height: 100%;
}

/* Fix n8n fullscreen scroll containment (n8n issue #16287): keep the message
 * list as the single internal scroll area so sending a message scrolls the
 * list, not the whole page. */
.chatkit-embedded .chat-layout {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.chatkit-embedded .chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Persistent footer line under the input (n8n only shows its footer on the
 * optional welcome screen, so we render our own). */
.chatkit-embedded .chatkit-custom-footer {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--chat--color-dark, #101330);
  background: var(--chat--input--container--background, #fff);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .chatkit-embedded-wrapper {
    background: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}

@media (max-width: 768px) {
  .chatkit-embedded-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 !important;
  }
}

@media (max-width: 480px) {
  .chatkit-embedded-wrapper {
    min-height: 400px;
  }
}

@media print {
  .chatkit-embedded-wrapper {
    display: none !important;
  }
}

@media (prefers-contrast: high) {
  .chatkit-embedded-wrapper {
    border: 2px solid currentColor;
  }
}
