/* ============================================
   ASSURE OVERSEAS — Production AI Counsellor CSS
   Fully Responsive (320px to 1440px+), Accessible,
   KC Design System Integration
   ============================================ */

/* ---- Scroll-Top Offset Adjustment ---- */
.scroll-top {
  right: 98px !important;
}

/* ---- Launcher Widget Container ---- */
.assure-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ---- Greeting Callout Bubble ---- */
.assure-chat-callout {
  position: relative;
  background: #ffffff;
  color: #1A1A1A;
  padding: 12px 18px;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 10px 30px rgba(10, 45, 111, 0.18);
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: assureFloatCallout 3s ease-in-out infinite alternate;
  border: 1px solid rgba(75, 164, 60, 0.2);
  transform-origin: bottom right;
}

.assure-chat-callout-close {
  background: transparent;
  border: none;
  color: #8B95A5;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  min-width: 28px;
  min-height: 28px;
  line-height: 1;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin-left: auto;
}

.assure-chat-callout-close:hover,
.assure-chat-callout-close:focus-visible {
  color: #1A1A1A;
  background: #f0f4f9;
  outline: 2px solid #0A2D6F;
}

@keyframes assureFloatCallout {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* ---- Launcher Button ---- */
.assure-chat-launcher {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0A2D6F 0%, #4BA43C 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 10px 28px rgba(10, 45, 111, 0.3), 0 0 0 4px rgba(75, 164, 60, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  overflow: hidden;
}

.assure-chat-launcher:hover,
.assure-chat-launcher:focus-visible {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 14px 35px rgba(10, 45, 111, 0.38), 0 0 0 6px rgba(75, 164, 60, 0.35);
  outline: 2px solid #0A2D6F;
}

.assure-chat-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.assure-chat-launcher .close-icon {
  display: none;
  font-size: 26px;
  color: #ffffff;
  font-weight: bold;
}

.assure-chat-widget.active .assure-chat-launcher img {
  display: none;
}
.assure-chat-widget.active .assure-chat-launcher .close-icon {
  display: block;
}
.assure-chat-widget.active .assure-chat-callout {
  display: none !important;
}

/* Unread Badge */
.assure-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: #ff4757;
  color: #ffffff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  animation: assurePulseBadge 2s infinite;
}

@keyframes assurePulseBadge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(255, 71, 87, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* ---- Chat Container Window ---- */
.assure-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(10, 45, 111, 0.22), 0 0 0 1px rgba(10, 45, 111, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.34, 1.25, 0.64, 1);
  transform-origin: bottom right;
}

/* Expanded Desktop State */
.assure-chat-window.expanded {
  width: 540px;
  height: 680px;
}

.assure-chat-widget.active .assure-chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---- Chat Header ---- */
.assure-chat-header {
  background: #ffffff;
  color: #1A202C;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf2f7;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.assure-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assure-chat-avatar-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0A2D6F;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.assure-chat-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assure-chat-header-titles h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1A202C;
  letter-spacing: 0.1px;
}

.assure-chat-header-titles p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #38A169;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.assure-chat-header-titles p::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #38A169;
  border-radius: 50%;
}

.assure-chat-header-actions {
  display: flex;
  gap: 8px;
}

.assure-chat-header-btn {
  background: transparent;
  border: none;
  color: #718096;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.assure-chat-header-btn:hover,
.assure-chat-header-btn:focus-visible {
  background: #EDF2F7;
  color: #1A202C;
  outline: 2px solid #6B46C1;
}

/* ---- Body / Messages List ---- */
.assure-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #F7FAFC;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.assure-chat-body::-webkit-scrollbar {
  width: 5px;
}
.assure-chat-body::-webkit-scrollbar-thumb {
  background: rgba(10, 45, 111, 0.15);
  border-radius: 10px;
}

/* Message Sender Header Label */
.assure-msg-sender-meta {
  font-size: 12px;
  font-weight: 700;
  color: #2D3748;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.assure-msg-sender-meta .time-stamp {
  font-size: 11px;
  font-weight: 400;
  color: #A0AEC0;
}

/* Message Item Rows */
.assure-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 92%;
  animation: assureMsgFadeIn 0.25s ease-out forwards;
}

.assure-msg-row.bot {
  align-self: flex-start;
}

.assure-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

@keyframes assureMsgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.assure-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(10, 45, 111, 0.1);
  background: #0A2D6F;
}

.assure-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #6B46C1;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assure-msg-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.assure-msg-row.bot .assure-msg-bubble {
  background: #ffffff;
  color: #2D3748;
  border: 1px solid #E2E8F0;
  border-top-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.assure-msg-row.user .assure-msg-bubble {
  background: #6B46C1;
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.25);
}

/* Action Icons Bar below bot messages (Copy, Like, Dislike) */
.assure-msg-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding-left: 2px;
}

.assure-action-btn {
  background: transparent;
  border: none;
  color: #A0AEC0;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 28px;
  min-height: 28px;
}

.assure-action-btn:hover,
.assure-action-btn:focus-visible {
  color: #4A5568;
  background: #EDF2F7;
  outline: 2px solid #6B46C1;
}

/* ---- Selectable Checkbox Pills & Chips Container ---- */
.assure-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.assure-chip-btn {
  background: #ffffff;
  color: #0A2D6F;
  border: 1px solid #E2E8F0;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}

.assure-chip-btn:hover,
.assure-chip-btn:focus-visible {
  background: #0A2D6F;
  color: #ffffff;
  border-color: #0A2D6F;
  transform: translateY(-1px);
  outline: 2px solid #4BA43C;
}

/* Selectable Checkbox Pill */
.assure-checkbox-pill {
  background: #ffffff;
  color: #4A5568;
  border: 1px solid #E2E8F0;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  min-height: 36px;
}

.assure-checkbox-pill:hover,
.assure-checkbox-pill:focus-visible {
  border-color: #6B46C1;
  color: #6B46C1;
  background: #F7FAFC;
  outline: 2px solid #6B46C1;
}

.assure-checkbox-pill.selected {
  background: #F3E8FF;
  border-color: #6B46C1;
  color: #6B46C1;
  font-weight: 600;
}

.assure-checkbox-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid #CBD5E0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.assure-checkbox-pill.selected .assure-checkbox-box {
  background: #6B46C1;
  border-color: #6B46C1;
}

.assure-checkbox-pill.selected .assure-checkbox-box::after {
  content: '✓';
  color: #ffffff;
  font-size: 11px;
  font-weight: bold;
}

/* Dotted Write-in Pill ("Something else...") */
.assure-dotted-pill {
  border: 1.5px dashed #CBD5E0 !important;
  background: transparent !important;
  color: #718096 !important;
}
.assure-dotted-pill:hover {
  border-color: #6B46C1 !important;
  color: #6B46C1 !important;
}

/* Submit Selection Button */
.assure-pill-submit-btn {
  background: linear-gradient(135deg, #6B46C1 0%, #0A2D6F 100%);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.25);
  min-height: 38px;
}

.assure-pill-submit-btn:hover,
.assure-pill-submit-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: 2px solid #4BA43C;
}

/* Consultation Form in Chat */
.assure-chat-form-box {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.assure-chat-form-box h5 {
  font-size: 14px;
  font-weight: 700;
  color: #0A2D6F;
  margin-bottom: 12px;
}

.assure-chat-input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
  transition: border 0.2s ease;
}

.assure-chat-input-field:focus {
  border-color: #6B46C1;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.12);
}

.assure-chat-form-submit {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #4BA43C 0%, #7BCB4A 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
  min-height: 42px;
}

.assure-chat-form-submit:hover,
.assure-chat-form-submit:focus-visible {
  filter: brightness(1.05);
  outline: 2px solid #0A2D6F;
}

/* Typing Indicator Animation */
.assure-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 18px;
  border-top-left-radius: 4px;
  border: 1px solid #E2E8F0;
  width: fit-content;
}

.assure-typing-dot {
  width: 7px;
  height: 7px;
  background: #6B46C1;
  border-radius: 50%;
  animation: assureTyping 1.4s infinite ease-in-out both;
}

.assure-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.assure-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.assure-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes assureTyping {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Footer / Input Area ---- */
.assure-chat-footer {
  padding: 12px 16px 8px 16px;
  background: #ffffff;
  border-top: 1px solid #EDF2F6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assure-chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assure-chat-text-input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid #E2E8F0;
  border-radius: 25px;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #2D3748;
  min-height: 42px;
}

.assure-chat-text-input:focus {
  border-color: #6B46C1;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.12);
}

.assure-chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #EDF2F7;
  border: none;
  color: #718096;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.assure-chat-send-btn.has-text {
  background: linear-gradient(135deg, #6B46C1 0%, #0A2D6F 100%);
  color: #ffffff;
}

.assure-chat-send-btn:hover,
.assure-chat-send-btn:focus-visible {
  transform: scale(1.05);
  outline: 2px solid #6B46C1;
}

.assure-chat-branding {
  font-size: 11px;
  color: #A0AEC0;
  text-align: center;
  font-weight: 500;
  padding-bottom: 2px;
}

.assure-chat-branding strong {
  color: #4A5568;
}

/* ============================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ============================================ */

/* Desktop Large (1440px+) */
@media (min-width: 1440px) {
  .assure-chat-window.expanded {
    width: 580px;
    height: 720px;
  }
}

/* Tablets & Small Laptops (768px - 1024px) */
@media (max-width: 1024px) {
  .assure-chat-window {
    width: 380px;
    height: 550px;
  }
}

/* Mobile Phones (320px, 375px, 414px, up to 480px) */
@media (max-width: 480px) {
  .scroll-top {
    right: 16px !important;
    bottom: 86px !important;
  }

  .assure-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .assure-chat-widget.active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
  }

  .assure-chat-widget.active .assure-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .assure-chat-header {
    padding: 12px 16px;
  }

  .assure-chat-header-actions #assure-chat-expand {
    display: none; /* Hide expand button on mobile screen */
  }

  .assure-chat-body {
    padding: 12px;
  }

  .assure-msg-row {
    max-width: 96%;
  }

  .assure-chat-footer {
    padding: 10px 12px;
  }

  .assure-chat-text-input {
    font-size: 14px; /* Prevents auto-zoom on iOS */
  }
}
