/* ==========================================================
   Big Drop Visitor Widget — Clean v1.0.3
   ========================================================== */

/* Reset (scoped) */
#bd-widget-root,
#bd-widget-root *,
#bd-widget-root *::before,
#bd-widget-root *::after {
  box-sizing: border-box;
}

#bd-widget-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1A1A1A;
  -webkit-font-smoothing: antialiased;
}
#bd-widget-root.bd-widget-left { right: auto; left: 24px; }

/* ==========================================================
   FLOATING ACTION BUTTON
   ========================================================== */
.bd-widget-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bdw-color, #7FD344);
  color: #1F0D5E;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(127, 211, 68, 0.45), 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.25s ease;
  position: relative;
  font-family: inherit;
}
.bd-widget-fab:hover { transform: scale(1.07); }
.bd-widget-fab:active { transform: scale(0.96); }

.bd-widget-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--bdw-color, #7FD344);
  opacity: 0.35;
  z-index: -1;
  animation: bd-widget-pulse 2.2s infinite;
}
@keyframes bd-widget-pulse {
  0%   { transform: scale(1);   opacity: 0.35; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.bd-widget-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #C11501;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ==========================================================
   PANEL — SIMPLE FLEX LAYOUT
   Structure:
     .bd-widget-panel
       .bd-widget-head          (fixed height)
       #bdw-content             (flex: 1, contains body + foot)
         .bd-widget-body        (scrollable)
         .bd-widget-foot        (fixed)
       .bd-widget-branding      (fixed, hidden on start form)
   ========================================================== */
.bd-widget-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);

  /* Fixed height, min 500px, max what fits on screen */
  height: min(560px, calc(100vh - 120px));
  max-height: calc(100vh - 100px);

  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(31, 13, 94, 0.25), 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;

  /* SIMPLE: vertical flex — head, content, branding */
  display: flex;
  flex-direction: column;

  animation: bd-widget-open 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}
#bd-widget-root.bd-widget-left .bd-widget-panel {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}
@keyframes bd-widget-open {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================
   HEADER (top row)
   ========================================================== */
.bd-widget-head {
  background: linear-gradient(135deg, #1F0D5E, #2F1A7A);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-height: 68px;
}
.bd-widget-head-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bdw-color, #7FD344);
  color: #1F0D5E;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.bd-widget-head-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #7FD344;
  border: 2px solid #1F0D5E;
}
.bd-widget-head-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bd-widget-head-title {
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-widget-head-sub {
  font-size: 11px;
  opacity: 0.85;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  white-space: nowrap;
}
.bd-widget-head-sub::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7FD344;
}
.bd-widget-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}
.bd-widget-close:hover { background: rgba(255, 255, 255, 0.28); }

/* ==========================================================
   CONTENT WRAPPER (#bdw-content)
   This is the flex:1 middle section that holds body + foot
   ========================================================== */
.bd-widget-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================
   CHAT BODY — scrollable
   ========================================================== */
.bd-widget-body {
  flex: 1;
  min-height: 0;
  padding: 16px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #F9FBFF;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 211, 68, 0.4) transparent;
}
.bd-widget-body::-webkit-scrollbar { width: 6px; }
.bd-widget-body::-webkit-scrollbar-track { background: transparent; }
.bd-widget-body::-webkit-scrollbar-thumb {
  background: rgba(127, 211, 68, 0.4);
  border-radius: 4px;
}
.bd-widget-body::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 211, 68, 0.65);
}

.bd-widget-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  animation: bd-widget-msg-in 0.2s ease;
}
@keyframes bd-widget-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bd-widget-msg-visitor {
  background: var(--bdw-color, #7FD344);
  color: #1F0D5E;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.bd-widget-msg-agent {
  background: #fff;
  color: #1A1A1A;
  border: 1px solid #E9EBF2;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bd-widget-msg-system {
  align-self: center;
  background: transparent;
  color: #6C6F8C;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  padding: 4px 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ==========================================================
   FOOTER (input + send) — fixed at bottom
   ========================================================== */
.bd-widget-foot {
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid #E9EBF2;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.bd-widget-foot textarea {
  flex: 1;
  min-height: 40px;
  max-height: 90px;
  border: 1.5px solid #E9EBF2;
  border-radius: 20px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: #1A1A1A;
  resize: none;
  background: #F9FAFE;
  transition: border-color 0.15s;
  line-height: 1.4;
  outline: none;
}
.bd-widget-foot textarea:focus {
  border-color: var(--bdw-color, #7FD344);
  background: #fff;
}
.bd-widget-send {
  background: var(--bdw-color, #7FD344);
  color: #1F0D5E;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  padding: 0;
}
.bd-widget-send:hover { transform: scale(1.06); }
.bd-widget-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================
   PRE-CHAT FORM — replaces the body, occupies whole content
   ========================================================== */
.bd-widget-form {
  flex: 1;
  min-height: 0;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F9FBFF;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 211, 68, 0.4) transparent;
}
.bd-widget-form::-webkit-scrollbar { width: 6px; }
.bd-widget-form::-webkit-scrollbar-thumb {
  background: rgba(127, 211, 68, 0.4);
  border-radius: 4px;
}
.bd-widget-form h3 {
  font-size: 15px;
  margin: 0;
  color: #1F0D5E;
  font-weight: 800;
  line-height: 1.3;
}
.bd-widget-form p {
  font-size: 12.5px;
  color: #6C6F8C;
  margin: 0 0 8px;
  line-height: 1.5;
}
.bd-widget-form input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E9EBF2;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  color: #1A1A1A;
  transition: border-color 0.15s;
  outline: none;
}
.bd-widget-form input:focus {
  border-color: var(--bdw-color, #7FD344);
}
.bd-widget-form .bd-widget-start {
  background: var(--bdw-color, #7FD344);
  color: #1F0D5E;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.15s;
  box-shadow: 0 8px 20px rgba(127, 211, 68, 0.3);
}
.bd-widget-form .bd-widget-start:hover { transform: translateY(-1px); }
.bd-widget-form .bd-widget-start:disabled { opacity: 0.6; cursor: not-allowed; }

.bd-widget-error {
  color: #C11501;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* ==========================================================
   BRANDING — small text at the very bottom
   ========================================================== */
.bd-widget-branding {
  flex-shrink: 0;
  text-align: center;
  font-size: 10px;
  color: #A0A5CE;
  padding: 6px 0 8px;
  background: #fff;
  border-top: 1px solid #F0F2FA;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.bd-widget-branding strong { color: #7FD344; }

/* Hide branding when showing the start form (cleaner) */
.bd-widget-panel.is-form .bd-widget-branding { display: none; }

/* ==========================================================
   MOBILE
   ========================================================== */
@media (max-width: 520px) {
  #bd-widget-root { bottom: 16px; right: 16px; }
  #bd-widget-root.bd-widget-left { left: 16px; right: auto; }

  .bd-widget-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    max-height: calc(100vh - 90px);
    bottom: 72px;
    right: -8px;
  }
  #bd-widget-root.bd-widget-left .bd-widget-panel {
    left: -8px;
    right: auto;
  }
}
/* ==========================================================
   v1.7.3 — the website theme was recolouring headings and
   paragraphs inside the widget (dark text on the navy header).
   Colours are pinned here so every word stays readable.
   ========================================================== */
#bd-widget-root .bd-widget-head,
#bd-widget-root .bd-widget-head * { color: #FFFFFF !important; }
#bd-widget-root .bd-widget-head-avatar { color: #1F0D5E !important; }
#bd-widget-root .bd-widget-head-title { color: #FFFFFF !important; font-size: 15px; font-weight: 800; text-shadow: none; }
#bd-widget-root .bd-widget-head-sub { color: #E4E7FF !important; opacity: 1 !important; font-weight: 600; }
#bd-widget-root .bd-widget-close { color: #FFFFFF !important; background: rgba(255,255,255,.18); }
#bd-widget-root .bd-widget-form h3 { color: #1F0D5E !important; }
#bd-widget-root .bd-widget-form p { color: #4A4E6E !important; }
#bd-widget-root .bd-widget-form input,
#bd-widget-root .bd-widget-foot textarea { color: #1A1A1A !important; background: #FFFFFF !important; -webkit-text-fill-color: #1A1A1A; }
#bd-widget-root .bd-widget-form input::placeholder,
#bd-widget-root .bd-widget-foot textarea::placeholder { color: #6C6F8C !important; opacity: 1; -webkit-text-fill-color: #6C6F8C; }
#bd-widget-root .bd-widget-form .bd-widget-start { color: #1F0D5E !important; }
#bd-widget-root .bd-widget-msg-visitor { color: #1F0D5E !important; }
#bd-widget-root .bd-widget-msg-agent { color: #1A1A1A !important; background: #FFFFFF; }
#bd-widget-root .bd-widget-msg-system { color: #555A7C !important; }
#bd-widget-root .bd-widget-branding { color: #6C6F8C !important; }
#bd-widget-root ::selection { background: #7FD344; color: #1F0D5E; }
/* Dark website / dark OS: keep the panel dark and readable too */
@media (prefers-color-scheme: dark) {
  #bd-widget-root .bd-widget-panel { background: #17142B; }
  #bd-widget-root .bd-widget-body, #bd-widget-root .bd-widget-form { background: #100E22; }
  #bd-widget-root .bd-widget-foot, #bd-widget-root .bd-widget-branding { background: #17142B; border-color: #2C2947; }
  #bd-widget-root .bd-widget-msg-agent { background: #221F3D; color: #F1F2FF !important; border-color: #36335A; }
  #bd-widget-root .bd-widget-msg-system { color: #C9CCE8 !important; }
  #bd-widget-root .bd-widget-form h3 { color: #FFFFFF !important; }
  #bd-widget-root .bd-widget-form p { color: #C9CCE8 !important; }
  #bd-widget-root .bd-widget-form input, #bd-widget-root .bd-widget-foot textarea { background: #221F3D !important; color: #F1F2FF !important; -webkit-text-fill-color: #F1F2FF; border-color: #36335A; }
  #bd-widget-root .bd-widget-form input::placeholder, #bd-widget-root .bd-widget-foot textarea::placeholder { color: #A9AED3 !important; -webkit-text-fill-color: #A9AED3; }
  #bd-widget-root .bd-widget-branding { color: #A9AED3 !important; }
}

/* ===== v1.7.3: autofill keeps the field readable; slim scrollbars for the message box and chat ===== */
#bd-widget-root .bd-widget-form input:-webkit-autofill,
#bd-widget-root .bd-widget-form input:-webkit-autofill:hover,
#bd-widget-root .bd-widget-form input:-webkit-autofill:focus,
#bd-widget-root .bd-widget-foot textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
  -webkit-text-fill-color: #1A1A1A !important;
  caret-color: #1A1A1A;
  transition: background-color 9999s ease-out 0s;
}
@media (prefers-color-scheme: dark) {
  #bd-widget-root .bd-widget-form input:-webkit-autofill,
  #bd-widget-root .bd-widget-form input:-webkit-autofill:hover,
  #bd-widget-root .bd-widget-form input:-webkit-autofill:focus,
  #bd-widget-root .bd-widget-foot textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #221F3D inset !important;
    -webkit-text-fill-color: #F1F2FF !important;
    caret-color: #F1F2FF;
  }
}
#bd-widget-root .bd-widget-foot textarea {
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 211, 68, 0.75) transparent;
}
#bd-widget-root .bd-widget-foot textarea::-webkit-scrollbar,
#bd-widget-root .bd-widget-body::-webkit-scrollbar { width: 6px; height: 6px; }
#bd-widget-root .bd-widget-foot textarea::-webkit-scrollbar-button,
#bd-widget-root .bd-widget-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
#bd-widget-root .bd-widget-foot textarea::-webkit-scrollbar-track,
#bd-widget-root .bd-widget-body::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
#bd-widget-root .bd-widget-foot textarea::-webkit-scrollbar-thumb,
#bd-widget-root .bd-widget-body::-webkit-scrollbar-thumb { background: rgba(127, 211, 68, 0.7); border-radius: 6px; }
#bd-widget-root .bd-widget-foot textarea::-webkit-scrollbar-thumb:hover,
#bd-widget-root .bd-widget-body::-webkit-scrollbar-thumb:hover { background: #7FD344; }
#bd-widget-root .bd-widget-foot textarea::-webkit-scrollbar-corner { background: transparent; }
