/* Scoped styles for Elixir Assistant WordPress Widget
 * Resilient against Traveler Bootstrap 3 (.col-md-3 250-300px) and Extendable block theme.
 */

#ea-widget-root.ea-widget,
#ea-bubble-root.ea-widget,
.ea-widget {
  --ea-accent: #0284c7;
  --ea-bg: #ffffff;
  --ea-surface: #f8fafc;
  --ea-border: #e2e8f0;
  --ea-text: #0f172a;
  --ea-muted: #64748b;
  --ea-danger: #dc2626;
  --ea-danger-bg: #fef2f2;
  --ea-warn-bg: #fffbeb;
  --ea-warn-border: #fcd34d;
  --ea-warn-text: #92400e;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ea-text);
  text-align: left;
}

.ea-widget *,
.ea-widget *::before,
.ea-widget *::after {
  box-sizing: border-box;
}

.ea-widget .ea-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Inline Sidebar Mode (Traveler .col-md-3 250px-300px safe) */
#ea-widget-root.ea-mode-inline,
.ea-widget.ea-mode-inline {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: block;
}

#booking-request .form-book-wrapper #ea-widget-root.ea-mode-inline,
#booking-request .form-book-wrapper .ea-widget.ea-mode-inline {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.ea-widget.ea-mode-inline .ea-panel {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 280px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--ea-bg);
  border: 1px solid var(--ea-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* Traveler Mobile < 992px #booking-request full-screen overlay */
@media (max-width: 991px) {
  #booking-request .form-book-wrapper .ea-mode-inline .ea-panel,
  #booking-request .form-book-wrapper #ea-widget-root.ea-mode-inline .ea-panel {
    height: 72vh;
    min-height: 360px;
    max-height: 80vh;
  }
}

/* Floating Bubble + Drawer Mode (Extendable / sitewide) */
#ea-bubble-root.ea-mode-bubble,
.ea-widget.ea-mode-bubble {
  position: static;
}

.ea-widget .ea-bubble-trigger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  margin: 0;
  border: none;
  border-radius: 9999px;
  background: var(--ea-accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ea-widget .ea-bubble-trigger:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.ea-widget .ea-bubble-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.ea-widget .ea-drawer {
  position: fixed;
  right: 18px;
  bottom: 76px;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 104px));
  z-index: 99991;
  display: flex;
  flex-direction: column;
  background: var(--ea-bg);
  border: 1px solid var(--ea-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.ea-widget .ea-drawer[hidden] {
  display: none !important;
}

/* Header */
.ea-widget .ea-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ea-accent);
  color: #ffffff;
  flex-shrink: 0;
  min-width: 0;
}

.ea-widget .ea-header-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}

.ea-widget .ea-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.ea-widget .ea-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ea-widget .ea-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ea-widget .ea-reset-btn,
.ea-widget .ea-close-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.ea-widget .ea-reset-btn:hover,
.ea-widget .ea-close-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Seamless Traveler #booking-request .form-book-wrapper Integration */
.ea-widget.ea-in-traveler-box .ea-panel,
#ea-widget-root.ea-in-traveler-box .ea-panel {
  border: 0;
  border-radius: 0 0 4px 4px;
  box-shadow: none;
}

.ea-widget.ea-in-traveler-box .ea-header {
  background: var(--ea-surface);
  color: var(--ea-text);
  border-bottom: 1px solid var(--ea-border);
}

.ea-widget.ea-in-traveler-box .ea-reset-btn {
  background: #ffffff;
  color: var(--ea-text);
  border: 1px solid #cbd5e1;
}

.ea-widget.ea-in-traveler-box .ea-reset-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Messages Stream */
.ea-widget .ea-messages {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background: var(--ea-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ea-widget .ea-msg {
  max-width: 92%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.ea-widget .ea-msg--assistant {
  align-self: flex-start;
  background: #ffffff;
  color: var(--ea-text);
  border: 1px solid var(--ea-border);
  border-bottom-left-radius: 3px;
}

.ea-widget .ea-msg--user {
  align-self: flex-end;
  background: var(--ea-accent);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.ea-widget .ea-msg-body {
  min-width: 0;
  word-break: break-word;
}

/* Quick-Reply Pills */
.ea-widget .ea-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ea-widget .ea-pill-btn {
  appearance: none;
  background: #eff6ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 9999px;
  padding: 5px 10px;
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.ea-widget .ea-pill-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: var(--ea-accent);
}

.ea-widget .ea-pill-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* List Picker Card */
.ea-widget .ea-list-card {
  margin-top: 8px;
  background: #f8fafc;
  border: 1px solid var(--ea-border);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.ea-widget .ea-list-toggle {
  width: 100%;
  appearance: none;
  background: #ffffff;
  color: var(--ea-accent);
  border: none;
  border-bottom: 1px solid var(--ea-border);
  padding: 7px 10px;
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ea-widget .ea-list-header {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ea-muted);
  background: #f1f5f9;
  border-bottom: 1px solid var(--ea-border);
}

.ea-widget .ea-list-items[hidden] {
  display: none;
}

.ea-widget .ea-list-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  appearance: none;
  background: #ffffff;
  color: var(--ea-text);
  border: none;
  border-bottom: 1px solid var(--ea-border);
  padding: 7px 10px;
  margin: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.ea-widget .ea-list-row:last-child {
  border-bottom: none;
}

.ea-widget .ea-list-row:hover:not(:disabled) {
  background: #f0f9ff;
}

.ea-widget .ea-list-row:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ea-widget .ea-list-row-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ea-text);
  word-break: break-word;
}

.ea-widget .ea-list-row-desc {
  font-size: 11.5px;
  color: var(--ea-muted);
  word-break: break-word;
}

/* Compact 3-Field Inline Contact Form Card (fits 250px sidebar) */
.ea-widget .ea-contact-card {
  margin-top: 8px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--ea-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.ea-widget .ea-contact-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ea-widget .ea-contact-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ea-text);
  margin: 0;
}

.ea-widget .ea-contact-input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ea-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
  height: auto;
}

.ea-widget .ea-contact-input:focus {
  outline: none;
  border-color: var(--ea-accent);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.18);
}

.ea-widget .ea-contact-error {
  font-size: 11.5px;
  color: var(--ea-danger);
  min-height: 0;
}

.ea-widget .ea-contact-submit {
  width: 100%;
  padding: 7px 10px;
  margin-top: 2px;
  border: none;
  border-radius: 6px;
  background: var(--ea-accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ea-widget .ea-contact-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Status Banners & Typing Indicator */
.ea-widget .ea-handoff-banner {
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--ea-warn-bg);
  border: 1px solid var(--ea-warn-border);
  color: var(--ea-warn-text);
  font-size: 12px;
  font-weight: 500;
}

.ea-widget .ea-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--ea-danger-bg);
  border: 1px solid #fecaca;
  color: var(--ea-danger);
  font-size: 12px;
}

.ea-widget .ea-retry-btn {
  appearance: none;
  background: #ffffff;
  color: var(--ea-danger);
  border: 1px solid #fca5a5;
  border-radius: 5px;
  padding: 3px 8px;
  margin: 0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.ea-widget .ea-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  background: #ffffff;
  border: 1px solid var(--ea-border);
  border-radius: 10px;
  align-self: flex-start;
}

.ea-widget .ea-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ea-muted);
  animation: eaBounce 1.1s infinite ease-in-out;
}

.ea-widget .ea-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.ea-widget .ea-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes eaBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Composer */
.ea-widget .ea-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #ffffff;
  border-top: 1px solid var(--ea-border);
  flex-shrink: 0;
  min-width: 0;
}

.ea-widget .ea-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 7px 10px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ea-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.ea-widget .ea-input:focus {
  outline: none;
  border-color: var(--ea-accent);
}

.ea-widget .ea-send-btn {
  flex-shrink: 0;
  appearance: none;
  background: var(--ea-accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.ea-widget .ea-send-btn:disabled,
.ea-widget .ea-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Inline Booking Stepper & Question Box */
.ea-widget.ea-stepper .ea-messages {
  background: #ffffff;
  padding: 12px;
  gap: 10px;
}

.ea-widget .ea-step-card {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ea-widget .ea-step-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ea-text);
}

.ea-widget.ea-stepper .ea-quick-replies {
  margin-top: 2px;
}

.ea-widget.ea-stepper .ea-pill-btn {
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12.5px;
}

.ea-widget .ea-step-input-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 2px 0 0;
}

.ea-widget .ea-step-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.ea-widget .ea-step-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 7px 9px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ea-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.ea-widget .ea-step-input:focus {
  outline: none;
  border-color: var(--ea-accent);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.18);
}

.ea-widget .ea-step-submit {
  flex-shrink: 0;
  appearance: none;
  background: var(--ea-accent);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 7px 11px;
  margin: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
}

.ea-widget .ea-step-submit:hover:not(:disabled) {
  opacity: 0.94;
}

.ea-widget .ea-step-input:disabled,
.ea-widget .ea-step-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ea-widget .ea-qa-callout {
  padding: 9px 10px;
  border-radius: 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ea-widget .ea-qa-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ea-widget .ea-qa-question {
  font-size: 11.5px;
  font-weight: 700;
  color: #0369a1;
  word-break: break-word;
  min-width: 0;
}

.ea-widget .ea-qa-dismiss {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--ea-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.ea-widget .ea-qa-dismiss:hover {
  color: var(--ea-text);
  text-decoration: underline;
}

.ea-widget .ea-qa-answer {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ea-text);
  word-break: break-word;
}

.ea-widget .ea-composer.ea-question-box {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  background: var(--ea-surface);
  padding: 9px 10px;
}

.ea-widget .ea-question-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ea-muted);
  margin: 0;
}

.ea-widget .ea-question-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
