/*
 * Dr Q leaflet chat — styles for the NATIVE Tabler pages
 * (medicament_tabler.php / medicament_info_tabler.php), which do not load the
 * legacy stylesheet. AUTO-GENERATED from css/style.css by
 * tools/extract_chat_css.php — do not edit by hand; edit style.css and re-run.
 *
 * Markup + JS: includes/leaflet_chat.php (shared verbatim with the legacy pages).
 * Mobile overrides live in dq-chat-mobile.css, which loads AFTER this file.
 */

.leaflet_chat_btn {
  position: fixed;
  bottom: 60px; /* stack above found_mistake_btn */
  right: 10px;
  width: 230px;
  height: 106px;
  color: #fff;
  font-size: .9em;
  padding: 0;
  border-radius: 23px;
  text-align: center;
  cursor: pointer;
  transition: .3s;
  /* Below the Tabler offcanvas menu (z 1045) + its backdrop, above the
     other floating widgets (max 1001) — owner request 2026-08-27. */
  z-index: 1010;
  display: block; /* visible when rendered (CIPRALEX gated markup) */
}

.leaflet_chat_btn img {
  width: 230px;
  height: 106px;
  display: block;
}

.leaflet_chat_btn.is-open-image {
  width: 141px;
}

.leaflet_chat_btn.is-open-image img {
  width: 141px;
}

.leaflet_chat_btn:hover {

  transform: translateY(1px);
}

.leaflet_chat_modal_bg {
  display: none; /* toggled to flex when active */
  position: fixed;
  inset: 0;
  direction: ltr; /* keep physical right anchoring stable also on Hebrew pages */
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,.60);
  z-index: 1001;
  justify-content: center;
  align-items: center;
}

.leaflet_chat_modal_bg.is-open {
  justify-content: flex-end;
  align-items: flex-end;
  padding-right: 126px;
  padding-left: 0;
  padding-bottom: 66px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: dqDrQFadeIn .18s ease-out;
}

.leaflet_chat_modal_bg.is-docked {
  inset: auto;
  width: auto;
  height: auto;
  right: 126px;
  bottom: 66px;
  z-index: 2147483001;
  background: transparent;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0;
}

body.dq_drq_open .leaflet_chat_btn {
  display: none;
}

.leaflet_chat_modal {
  background: #fff;
  width: 477.06px;
  height: 332px;
  display: flex;
  flex-direction: column;
  border-radius: 40px;
  box-shadow: 0 2px 20px rgba(99,133,194,0.5);
  overscroll-behavior: none;
}

.leaflet_chat_corner_arrow {
  position: absolute;
  top: 18px;
  left: 18px;
  color: #323232;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 20;
}

.leaflet_chat_corner_arrow_icon {
  width: 24px;
  height: 24px;
  display: none;
}

.leaflet_chat_corner_arrow_icon--normal {
  display: block;
}

.leaflet_chat_corner_arrow.is-expanded .leaflet_chat_corner_arrow_icon--normal {
  display: none;
}

.leaflet_chat_corner_arrow.is-expanded .leaflet_chat_corner_arrow_icon--center {
  display: block;
}

.leaflet_chat_modal_bg.is-expanded {
  justify-content: center;
  align-items: center;
  padding-right: 0;
  padding-bottom: 0;
  z-index: 2147483001;
}

.leaflet_chat_modal.is-expanded {
  width: 1149px !important;
  height: 804.3px !important;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
}

.leaflet_chat_modal.is-expanded::after {
  content: "";
  position: fixed;
  left: calc(60vw - 1098.5px);
  bottom: -70px;
  width: 404px;
  height: 525.098px;
  background: url('/images/ask_dr_q_extended.png') center / contain no-repeat;
  pointer-events: none;
  z-index: 2147483002;
}

.leaflet_chat_modal.is-expanded .leaflet_chat_messages {
  padding: 131px 94px 16px;
}

.leaflet_chat_modal.is-expanded .leaflet_chat_form {
  padding: 0 94px 38px;
}

.leaflet_chat_modal.is-expanded .leaflet_chat_input_wrap {
  min-height: 74px;
  height: auto;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

.leaflet_chat_modal.is-expanded .leaflet_chat_send.btn {
  width: 60px !important;
  height: 60px !important;
}

.leaflet_chat_modal.is-expanded .leaflet_chat_send.btn svg {
  width: 60px;
  height: 60px;
}

@media (max-width: 1280px) {
.leaflet_chat_modal.is-expanded::after {
    left: calc(60vw - 1098.5px);
    bottom: -70px;
  }
}

.leaflet_chat_loader_overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.82);
  align-items: center;
  justify-content: center;
}

body.medicament .leaflet_chat_modal:not(.is-expanded),
body.medicament_info .leaflet_chat_modal:not(.is-expanded) {
  width: 477.062px !important;
  height: 474px !important;
}

body.medicament .leaflet_chat_modal.is-loading:not(.is-expanded),
body.medicament_info .leaflet_chat_modal.is-loading:not(.is-expanded) {
  width: 477.062px !important;
  height: 474px !important;
}

.leaflet_chat_loader_card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid #D8DCE3;
  background: #FFFFFF;
  box-shadow: 0 6px 24px rgba(13, 15, 43, 0.10);
}

.leaflet_chat_loader_spinner {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.leaflet_chat_loader_spinner img {
  width: 18px;
  height: 18px;
  display: block;
}

.leaflet_chat_loader_text {
  color: #323232;
  font-family: 'Rubik', sans-serif;
  font-size: 36px;
  font-style: normal;
  font-weight: 400;
  line-height: 40px;
  white-space: nowrap;
}

@media (max-width: 900px) {
.leaflet_chat_loader_text {
    font-size: 18px;
    line-height: 24px;
  }
}

.leaflet_chat_modal.is-loading:not(.is-expanded) {
  width: 477.06px !important;
  height: 332px !important;
  border-radius: 40px;
}

.leaflet_chat_modal.is-loading .leaflet_chat_messages,
.leaflet_chat_modal.is-loading .leaflet_chat_form {
  visibility: hidden;
}

.leaflet_chat_modal.is-loading .leaflet_chat_loader_overlay {
  background: transparent;
}

.leaflet_chat_modal.is-loading .leaflet_chat_loader_card {
  width: 390px;
  min-height: 82px;
  border-radius: 20px;
  background: rgba(224, 237, 244, 0.5);
  border: none;
  box-shadow: none;
  justify-content: center;
  padding: 16px 22px;
}

.leaflet_chat_modal.is-loading .leaflet_chat_loader_spinner {
  display: none;
}

.leaflet_chat_modal.is-loading .leaflet_chat_loader_text {
  color: #323232;
  text-align: center;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  text-align: center;
  white-space: normal;
}

@media (max-width: 700px) {
.leaflet_chat_modal {
    width: min(477.06px, calc(100vw - 24px));
    height: 332px;
  }
.leaflet_chat_modal.is-loading:not(.is-expanded) {
    width: min(477.06px, calc(100vw - 24px)) !important;
    height: 332px !important;
  }
.leaflet_chat_modal.is-loading .leaflet_chat_loader_card {
    width: calc(100% - 40px);
  }
.leaflet_chat_modal.is-loading .leaflet_chat_loader_text {
    font-size: 18px;
    line-height: normal;
  }
}

.leaflet_chat_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 16px;
  color: var(--color_purple);
  font-weight: 700;
  border-bottom: none;
  position: relative;
}

.leaflet_chat_close {
  position: absolute;
  top: 11px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.leaflet_chat_messages {
  padding: 14px 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;           /* allow proper scrolling inside flex container */
  display: flex;
  flex-direction: column;
  align-items: stretch;    /* each .leaflet_msg uses its own width/max-width */
  gap: 8px;
  overscroll-behavior: contain;
}

.leaflet_msg {
  margin: 0;
  max-width: 100%;
  width: fit-content;         /* bubble width is based on its content */
  min-width: 40%;             /* avoid tiny bubbles; tweak if needed */
  min-height: 40px;
  padding: 10px 15px;
  display: block;             /* each bubble sits on its own row in the column */
  flex: 0 0 auto;             /* do NOT shrink bubbles vertically in flex column */
  border-radius: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  color: var(--Text-Dark, #0D0F2B);
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;           /* default text weight: normal */
  line-height: 24px; /* 150% */
}

.leaflet_msg_label {
  font-weight: 700;
  margin-right: 4px;
}

.leaflet_msg.is-rtl .leaflet_msg_label {
  margin-right: 0;
  margin-left: 4px;
}

.leaflet_msg_text {
  font-weight: 400;
}

.leaflet_msg_text--rich {
  display: block;
  margin-top: 4px;
  white-space: normal;
}

.leaflet_msg_text--rich h1,
.leaflet_msg_text--rich h2,
.leaflet_msg_text--rich h3,
.leaflet_msg_text--rich h4,
.leaflet_msg_text--rich h5,
.leaflet_msg_text--rich h6 {
  margin: 0 0 6px;
  line-height: 1.35;
}

.leaflet_msg_text--rich p {
  margin: 0 0 6px;
}

.leaflet_msg_text--rich p:last-child,
.leaflet_msg_text--rich ul:last-child,
.leaflet_msg_text--rich ol:last-child,
.leaflet_msg_text--rich h1:last-child,
.leaflet_msg_text--rich h2:last-child,
.leaflet_msg_text--rich h3:last-child,
.leaflet_msg_text--rich h4:last-child,
.leaflet_msg_text--rich h5:last-child,
.leaflet_msg_text--rich h6:last-child {
  margin-bottom: 0;
}

.leaflet_msg_text--rich ul,
.leaflet_msg_text--rich ol {
  margin: 0 0 6px;
  padding-inline-start: 1.25em;
  list-style-position: outside;
}

.leaflet_msg_text--rich li {
  margin: 1px 0;
  padding-inline-start: 0;
}

.leaflet_msg_text--rich table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 6px;
  font-size: 14px;
  line-height: 1.4;
}

.leaflet_msg_text--rich th,
.leaflet_msg_text--rich td {
  border: 1px solid rgba(13, 15, 43, 0.2);
  padding: 6px 8px;
  text-align: start;
  vertical-align: top;
  /* Keep table headers/cells readable; avoid arbitrary mid-word splits. */
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

.leaflet_msg_text--rich thead th {
  background: rgba(13, 15, 43, 0.06);
  font-weight: 700;
}

.leaflet_msg_text--rich figure {
  margin: 6px 0;
}

.leaflet_msg_text--rich img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(13, 15, 43, 0.16);
  border-radius: 8px;
}

.leaflet_msg.is-rtl {
  direction: rtl;
  text-align: right;
}

.leaflet_msg.is-ltr {
  direction: ltr;
  text-align: left;
}

.leaflet_msg.user {
  background: rgba(205,206,212,0.50);
  border: none;
  border-radius: 20px;
  align-self: flex-end !important;
  margin-left: auto;
  margin-right: 0;
}

.leaflet_msg.assistant {
  background: rgba(219,186,207,0.50);
  border: none;
  border-radius: 20px;
  align-self: flex-start !important;
  margin-right: auto;
  margin-left: 0;
}

.leaflet_chat_form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 14px 16px 16px;
  border-top: none;
}

.leaflet_chat_input_wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 78px;
  height: auto;
  background: #ffffff;
  border: 1px solid #57778C; /* Secondary/Grey Blue */
  border-radius: 50px;
  padding-left: 24px;  /* left inner padding per design */
  padding-right: 143px; /* reserve space for send button (119px) + 24px gap */
  padding-top: 0;
  padding-bottom: 0;
}

.leaflet_chat_input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  height: 24px;
  max-height: none;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--Text-Dark, #0D0F2B);
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  padding: 0; /* wrapper controls inner padding */
}

.leaflet_chat_input::placeholder {
  color: #57778C;
  opacity: 1;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
}

.leaflet_chat_modal.is-expanded .leaflet_chat_input {
  max-height: 168px;
}

.leaflet_chat_send.btn {
  position: absolute;           /* place inside the input wrapper */
  right: 12px;
  left: auto;                   /* explicit for LTR */
  top: 50%;
  bottom: auto;
  margin-top: 0;
  transform: translateY(-50%);
  background: #9C5984 !important;
  color: inherit !important;
  height: 48px !important;
  width: 48px !important;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;
  line-height: 0;
  box-shadow: none;
  cursor: pointer;
}

.leaflet_chat_send.btn svg {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 50%;
}

.leaflet_chat_close:hover,
.leaflet_chat_send.btn:hover {
  filter: brightness(.97);
}

.leaflet_chat_modal[dir="rtl"] .leaflet_chat_send.btn { left: 12px; right: auto; }

.leaflet_chat_modal[dir="rtl"] .leaflet_chat_input_wrap { padding-left: 72px; padding-right: 24px; }

.leaflet_chat_modal[dir="rtl"] .leaflet_chat_send.btn svg { transform: scaleX(-1); }

.leaflet_chat_thinking { opacity: .6; font-style: italic; }

.leaflet_chat_clear {
  position: absolute;
  top: 13px;
  left: 52px;
  z-index: 21;
  border: 1px solid #E0E2E5;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--color_purple);
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.leaflet_chat_clear:hover {
  background: #F5F7FA;
}

.leaflet_chat_clear svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.leaflet_msg_error {
  background: #FFF0EF;
  border: 1px solid #F1C6C2;
  border-radius: 10px;
  padding: 10px 14px;
}

.leaflet_chat_retry_btn {
  display: inline-block;
  margin-inline-start: 10px;
  border: 0;
  border-radius: 8px;
  background: #E7655A;
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 14px;
  cursor: pointer;
  vertical-align: middle;
}

.leaflet_chat_retry_btn:hover {
  filter: brightness(.95);
}

/* Feedback belongs to one generated Doctor Q answer. */
.dq_feedback,
.dq_feedback_done {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(13, 15, 43, .12);
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
}

.dq_feedback_top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dq_feedback_prompt {
  margin-inline-end: 2px;
  color: #4d5266;
}

.dq_feedback_vote {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(87, 119, 140, .35);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  line-height: 1;
}

.dq_feedback_vote:hover,
.dq_feedback_vote.is-selected {
  border-color: #9c5984;
  background: #f6edf3;
}

.dq_feedback_form:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 8px;
}

.dq_feedback_comment {
  min-width: 180px;
  min-height: 54px;
  max-height: 120px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid #b7c2ca;
  border-radius: 9px;
  background: #fff;
  color: #0d0f2b;
  font: 13px/1.4 'Rubik', sans-serif;
}

.dq_feedback_comment:focus {
  border-color: #9c5984;
  outline: 2px solid rgba(156, 89, 132, .15);
}

.dq_feedback_submit {
  align-self: end;
  min-height: 36px;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: #9c5984;
  color: #fff;
  font: 600 13px/1 'Rubik', sans-serif;
  cursor: pointer;
}

.dq_feedback_submit:disabled {
  opacity: .55;
  cursor: wait;
}

.dq_feedback_status {
  grid-column: 1 / -1;
  color: #a03333;
}

.dq_feedback_status.is-success {
  color: #39724f;
  font-weight: 600;
}

.dq_feedback_status a {
  color: #7c3f67;
  text-decoration: underline;
}

.dq_feedback_done {
  color: #39724f;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .dq_feedback_form:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .dq_feedback_submit {
    justify-self: start;
  }
}

.leaflet_chat_input {
  margin-top: 0;
  border: none !important;   /* ensure no red/green borders applied */
}

.leaflet_chat_input:focus:invalid,
.leaflet_chat_input:required:invalid,
.leaflet_chat_input:valid,
.leaflet_chat_input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.leaflet_chat_btn {
  top: auto !important;
  bottom: 10px !important;
  right: 10px !important;
  left: auto !important;
  transform: none !important;
  will-change: auto;
}

.drugai_send_btn.leaflet_chat_send.btn {
  position: absolute;
  right: 12px;
  left: auto;
  top: 50%;
  bottom: auto;
  margin-top: 0;
  transform: translateY(-50%);
}

.drugai_form[dir="rtl"] .drugai_send_btn.leaflet_chat_send.btn {
  left: 12px;
  right: auto;
}

.drugai_form[dir="rtl"] .drugai_send_btn.leaflet_chat_send.btn svg {
  transform: scaleX(-1);
}

@keyframes dqDrQFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
