/**
 * INTECARE EXCELLENCE AWARD 2026 — AI ASSISTANT STYLING
 * 
 * BOOKLET DESIGN SYSTEM:
 * Deep Forest Emerald (#062E25) • Metallic Champagne Gold (#C5A059, #D4AF37) • Soft Ivory (#FAFBF8) • Deep Pine Black (#0D221D)
 * Typography: Barlow Condensed (Headings & Badges) + Manrope (Interface & Body)
 * STRICT POLICY: ZERO EMOJIS. Pure SVG & CSS vectors only.
 */

/* ==========================================================================
   1. FLOATING LAUNCHER BUTTON
   ========================================================================== */
#intecareAssistantLauncher {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #062E25;
  color: #FFFFFF;
  border: 1px solid rgba(197, 160, 89, 0.45);
  border-radius: 999px;
  padding: 0.65rem 1.25rem 0.65rem 0.85rem;
  box-shadow: 0 10px 30px rgba(2, 28, 22, 0.35), 0 0 0 1px rgba(197, 160, 89, 0.15);
  cursor: pointer;
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  user-select: none;
}

#intecareAssistantLauncher:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #D4AF37;
  box-shadow: 0 14px 36px rgba(2, 28, 22, 0.45), 0 0 18px rgba(197, 160, 89, 0.25);
  background: #093E32;
}

#intecareAssistantLauncher:focus-visible {
  outline: 2px solid #C5A059;
  outline-offset: 3px;
}

.ia-launcher-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(197, 160, 89, 0.18);
  border: 1px solid rgba(197, 160, 89, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4AF37;
  position: relative;
  flex-shrink: 0;
}

.ia-launcher-pulse {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C5A059;
  box-shadow: 0 0 8px #C5A059;
  border: 2px solid #062E25;
}

.ia-launcher-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.15;
}

.ia-launcher-title {
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ia-launcher-sub {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.68rem;
  color: #88B2BE;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ==========================================================================
   2. CHAT WINDOW / MODAL CONTAINER
   ========================================================================== */
#intecareAssistantWindow {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 80px);
  background: #FFFFFF;
  border: 1px solid #D6E4E0;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(3, 30, 40, 0.28), 0 4px 16px rgba(3, 30, 40, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#intecareAssistantWindow.ia-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.ia-header {
  background: #062E25;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(197, 160, 89, 0.25);
  color: #FFFFFF;
  user-select: none;
  flex-shrink: 0;
}

.ia-header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ia-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(197, 160, 89, 0.15);
  border: 1px solid rgba(197, 160, 89, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4AF37;
  flex-shrink: 0;
}

.ia-header-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.ia-header-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  text-transform: uppercase;
}

.ia-header-status {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.74rem;
  color: #C5A059;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.ia-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D4AF37;
  box-shadow: 0 0 6px #D4AF37;
  display: inline-block;
}

.ia-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ia-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #92B9C4;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.ia-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.15);
}

.ia-icon-btn:focus-visible {
  outline: 2px solid var(--color-lime-accent, #C6F24D);
}

/* ==========================================================================
   3. MESSAGES SCROLL AREA
   ========================================================================== */
.ia-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.15rem;
  background: #F8FAF9;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.ia-body::-webkit-scrollbar {
  width: 6px;
}
.ia-body::-webkit-scrollbar-track {
  background: transparent;
}
.ia-body::-webkit-scrollbar-thumb {
  background: #D0DED9;
  border-radius: 999px;
}
.ia-body::-webkit-scrollbar-thumb:hover {
  background: #B6CCC5;
}

/* Message Rows */
.ia-message-row {
  display: flex;
  gap: 0.65rem;
  max-width: 90%;
  animation: iaFadeSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes iaFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ia-message-row.ia-assistant {
  align-self: flex-start;
}

.ia-message-row.ia-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ia-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #031E28;
  color: var(--color-lime-accent, #C6F24D);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
  font-size: 0.75rem;
}

.ia-bubble {
  padding: 0.95rem 1.15rem;
  border-radius: 14px;
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(3, 30, 40, 0.04);
}

.ia-assistant .ia-bubble {
  background: #FFFFFF;
  color: #041D26;
  border: 1px solid #E1EBE7;
  border-top-left-radius: 4px;
}

.ia-assistant .ia-bubble p {
  margin-bottom: 0.65rem;
}
.ia-assistant .ia-bubble p:last-child {
  margin-bottom: 0;
}

.ia-assistant .ia-bubble ul,
.ia-assistant .ia-bubble ol {
  margin: 0.5rem 0 0.75rem 1.15rem;
  padding: 0;
}

.ia-assistant .ia-bubble li {
  margin-bottom: 0.35rem;
}

.ia-assistant .ia-bubble code {
  background: #EDF4F1;
  color: #087F8C;
  font-family: monospace;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 700;
}

.ia-assistant .ia-bubble strong {
  color: #062E25;
  font-weight: 700;
}

.ia-user .ia-bubble {
  background: #062E25;
  color: #FFFFFF;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-top-right-radius: 4px;
}

/* Contextual Actions Inside Message */
.ia-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #EBF1EE;
}

.ia-action-btn {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.2s ease;
  outline: none;
}

.ia-action-btn.ia-primary {
  background: #C5A059;
  color: #021C16;
  border: 1px solid #C5A059;
  box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

.ia-action-btn.ia-primary:hover {
  background: #D4AF37;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.45);
}

.ia-action-btn.ia-outline {
  background: #FFFFFF;
  color: #062E25;
  border: 1px solid rgba(197, 160, 89, 0.45);
}

.ia-action-btn.ia-outline:hover {
  background: #FAFBF8;
  border-color: #C5A059;
  color: #021C16;
}

/* ==========================================================================
   4. QUICK QUESTIONS CONTAINER
   ========================================================================== */
.ia-quick-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.ia-quick-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #6C8B94;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.ia-quick-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ia-quick-btn {
  background: #FFFFFF;
  border: 1px solid #D6E4E0;
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  color: #031E28;
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(3, 30, 40, 0.03);
}

.ia-quick-btn:hover {
  background: #EDF7F4;
  border-color: #087F8C;
  color: #087F8C;
  transform: translateX(3px);
}

.ia-quick-arrow {
  color: #8EB4BC;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.ia-quick-btn:hover .ia-quick-arrow {
  color: #087F8C;
  transform: translateX(2px);
}

/* ==========================================================================
   5. MINIMAL TYPING INDICATOR (NO EMOJI)
   ========================================================================== */
.ia-typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.85rem 1.15rem;
  background: #FFFFFF;
  border: 1px solid #E1EBE7;
  border-radius: 14px;
  border-top-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(3, 30, 40, 0.04);
}

.ia-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #087F8C;
  opacity: 0.4;
  animation: iaTypingPulse 1.2s infinite ease-in-out;
}

.ia-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ia-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes iaTypingPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  40% {
    transform: scale(1.3);
    opacity: 1;
    background: var(--color-lime-accent, #C6F24D);
  }
}

/* ==========================================================================
   6. INPUT BAR & FOOTER DISCLAIMER
   ========================================================================== */
.ia-footer {
  background: #FFFFFF;
  border-top: 1px solid #E2EAE7;
  padding: 0.85rem 1.15rem 0.65rem;
  flex-shrink: 0;
}

.ia-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #F4F8F6;
  border: 1px solid #D6E4E0;
  border-radius: 999px;
  padding: 0.35rem 0.45rem 0.35rem 1.05rem;
  transition: all 0.2s ease;
}

.ia-input-wrap:focus-within {
  background: #FFFFFF;
  border-color: #087F8C;
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.12);
}

.ia-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.88rem;
  color: #041D26;
  outline: none;
  padding: 0.35rem 0;
}

.ia-input::placeholder {
  color: #7E9FA7;
}

.ia-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #062E25;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.ia-send-btn:not(:disabled):hover {
  background: #C5A059;
  color: #021C16;
  transform: scale(1.05);
}

.ia-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #6D8E97;
}

.ia-send-btn:focus-visible {
  outline: 2px solid #C5A059;
}

.ia-disclaimer {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.65rem;
  color: #8BA8B1;
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   7. MOBILE RESPONSIVE ADAPTATION (Under 600px)
   ========================================================================== */
@media (max-width: 600px) {
  #intecareAssistantLauncher {
    bottom: 18px;
    right: 18px;
    padding: 0.55rem 0.95rem 0.55rem 0.65rem;
    font-size: 0.84rem;
  }

  .ia-launcher-icon-wrap {
    width: 32px;
    height: 32px;
  }

  .ia-launcher-sub {
    display: none;
  }

  #intecareAssistantWindow {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100dvh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .ia-header {
    padding: 1rem 1rem env(safe-area-inset-top, 0);
  }

  .ia-body {
    padding: 1rem 0.95rem;
  }

  .ia-footer {
    padding: 0.75rem 0.95rem calc(0.75rem + env(safe-area-inset-bottom, 0));
  }

  .ia-quick-btn {
    padding: 0.6rem 0.85rem;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #intecareAssistantWindow,
  #intecareAssistantLauncher,
  .ia-message-row,
  .ia-typing-dot {
    transition: none !important;
    animation: none !important;
  }
}
