@charset "UTF-8";
/* Monty Chatbot - The Halifax Academy - v1.1.0
   Every rule is scoped to #tha-chat-fab / #tha-chat-window so the theme and
   Elementor can't restyle the widget, and the widget can't leak into the site. */

/* === Resets against theme / Elementor global styles === */
#tha-chat-fab, #tha-chat-fab *,
#tha-chat-window, #tha-chat-window * {
  box-sizing: border-box;
  font-family: sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
}
#tha-chat-window div, #tha-chat-window p, #tha-chat-window span { margin: 0; padding: 0; }
#tha-chat-window button {
  margin: 0;
  min-height: 0;
  min-width: 0;
  line-height: normal;
  text-decoration: none;
  outline-offset: 2px;
}
#tha-chat-window textarea { margin: 0; background: #fff; width: auto; }
#tha-chat-fab img, #tha-chat-window img { max-width: 100%; margin: 0; border: 0; box-shadow: none; }
#tha-chat-window svg { display: block; }
#tha-chat-fab:focus-visible { outline: 3px solid #2a4a97; outline-offset: 3px; }


  /* Floating button */
  #tha-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 3px solid #6c2370;
    background: white;
    cursor: pointer;
    z-index: 2147483001;
    box-shadow: 0 6px 24px rgba(108,35,112,0.3), 0 3px 8px rgba(0,0,0,0.1), inset 0 2px 0 rgba(255,255,255,0.3), inset 0 -2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #tha-chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 32px rgba(108,35,112,0.4), 0 4px 12px rgba(0,0,0,0.15), inset 0 2px 0 rgba(255,255,255,0.3);
  }
  #tha-chat-fab img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    transform: scale(0.88);
  }
  #tha-chat-fab .fab-close {
    display: none;
    font-size: 1.5rem;
    color: #6c2370;
    font-weight: 700;
  }
  #tha-chat-fab.open img { display: none; }
  #tha-chat-fab.open .fab-close { display: block; }
  #tha-chat-fab.open {
    background: #F5F0FA;
    border-color: #6c2370;
  }

  /* Pulse ring effect */
  #tha-chat-fab::before,
  #tha-chat-fab::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border: 2.5px solid #6c2370;
    border-radius: 50%;
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
  }
  #tha-chat-fab::after {
    animation-delay: 1s;
  }
  @keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
  }
  #tha-chat-fab.open::before,
  #tha-chat-fab.open::after {
    animation: none;
    opacity: 0;
  }

  /* Chat window */
  #tha-chat-window {
    position: fixed;
    bottom: 104px;
    right: 24px;
    width: 380px;
    height: 520px;
    border-radius: 20px;
    overflow: hidden;
    z-index: 2147483000;
    box-shadow: 0 20px 60px rgba(42,74,151,0.2), 0 8px 24px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.5);
    display: none;
    flex-direction: column;
    background: #F7F6F3;
    border: 1px solid #E5E1DA;
    animation: windowIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  }
  #tha-chat-window.open { display: flex; }
  @keyframes windowIn {
    from { opacity:0; transform:translateY(20px) scale(0.95); }
    to { opacity:1; transform:translateY(0) scale(1); }
  }

  /* Header */
  #tha-chat-window .chat-header {
    background: linear-gradient(135deg, #2a4a97 0%, #6c2370 100%);
    color: white;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(42,74,151,0.3), inset 0 1px 0 rgba(255,255,255,0.15), inset 0 -1px 0 rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
  }
  #tha-chat-window .chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  #tha-chat-window .chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  #tha-chat-window .chat-header-info .chat-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
  }
  #tha-chat-window .chat-header-info .chat-subtitle {
    font-size: 0.78rem;
    opacity: 0.8;
  }
  #tha-chat-window .chat-header-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    opacity: 0.85;
  }
  #tha-chat-window .chat-header-status .dot {
    width: 7px; height: 7px;
    background: #4ADE80;
    border-radius: 50%;
  }

  /* Chat body */
  #tha-chat-window .chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scroll-behavior: smooth;
  }
  #tha-chat-window .chat-body::-webkit-scrollbar { width: 4px; }
  #tha-chat-window .chat-body::-webkit-scrollbar-track { background: transparent; }
  #tha-chat-window .chat-body::-webkit-scrollbar-thumb { background: #D1C9DB; border-radius: 99px; }

  /* Messages */
  #tha-chat-window .msg {
    display: flex;
    gap: 0.5rem;
    max-width: 88%;
    animation: msgIn 0.3s ease-out;
  }
  @keyframes msgIn { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:translateY(0);} }
  #tha-chat-window .msg.bot { align-self: flex-start; }
  #tha-chat-window .msg.user { align-self: flex-end; flex-direction: row-reverse; }

  #tha-chat-window .msg-avatar {
    width: 28px; height: 28px; min-width: 28px;
    border-radius: 50%;
    overflow: hidden;
    margin-top: 2px;
    flex-shrink: 0;
  }
  #tha-chat-window .msg.bot .msg-avatar { border: 1.5px solid #6c2370; }
  #tha-chat-window .msg.bot .msg-avatar img { width:100%; height:100%; object-fit:cover; }
  #tha-chat-window .msg.user .msg-avatar {
    background: #2a4a97;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.85rem; font-weight: 600;
  }

  #tha-chat-window .msg-bubble {
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  #tha-chat-window .msg.bot .msg-bubble {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8F7F5 100%);
    border: 1px solid #E5E1DA;
    border-bottom-left-radius: 4px;
    color: #1A1A1A;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.9);
  }
  #tha-chat-window .msg.user .msg-bubble {
    background: linear-gradient(135deg, #2a4a97, #6c2370);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(42,74,151,0.25), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.15);
  }
  #tha-chat-window .msg-bubble p { margin-bottom: 0.4rem; }
  #tha-chat-window .msg-bubble p:last-child { margin-bottom: 0; }
  #tha-chat-window .msg-bubble a { color: #6c2370; text-decoration: underline; text-underline-offset: 2px; }
  #tha-chat-window .msg.user .msg-bubble a { color: #E0D0F0; }
  #tha-chat-window .msg-bubble strong { font-weight: 600; }

  /* Quick replies */
  #tha-chat-window .quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
  }
  #tha-chat-window .qr-btn {
    background: linear-gradient(135deg, rgba(42,74,151,0.08), rgba(108,35,112,0.08));
    color: #6c2370;
    border: 1.5px solid rgba(108,35,112,0.25);
    border-radius: 99px;
    padding: 0.3rem 0.75rem;
    font-size: 0.73rem;
    font-family: sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }
  #tha-chat-window .qr-btn:hover {
    background: linear-gradient(135deg, #2a4a97, #6c2370);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
  }

  /* Typing indicator */
  #tha-chat-window .typing-indicator {
    display: none;
    align-self: flex-start;
    gap: 0.5rem;
    max-width: 88%;
    padding: 0 0 0.25rem;
  }
  #tha-chat-window .typing-indicator.show { display: flex; }
  #tha-chat-window .typing-dots {
    background: white;
    border: 1px solid #E5E1DA;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 0.7rem 1rem;
    display: flex;
    gap: 0.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  #tha-chat-window .typing-dots span {
    width: 8px; height: 8px;
    background: #B8AEC4;
    border-radius: 50%;
    animation: tbounce 1.4s infinite;
  }
  #tha-chat-window .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
  #tha-chat-window .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes tbounce { 0%,60%,100%{transform:translateY(0);} 30%{transform:translateY(-5px);} }

  /* Input area */
  #tha-chat-window .chat-input-area {
    padding: 0.5rem 0.65rem;
    background: linear-gradient(180deg, #FAFAFA 0%, #FFFFFF 100%);
    border-top: 1px solid #E5E1DA;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
    position: relative;
    z-index: 2;
  }
  #tha-chat-window .chat-input {
    flex: 1;
    border: 1.5px solid #E5E1DA;
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
    font-family: sans-serif;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 80px;
    min-height: 38px;
    line-height: 1.4;
    transition: border-color 0.2s;
    color: #1A1A1A;
  }
  #tha-chat-window .chat-input {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04), 0 1px 0 rgba(255,255,255,0.8);
  }
  #tha-chat-window .chat-input:focus {
    border-color: #6c2370;
    box-shadow: inset 0 2px 4px rgba(108,35,112,0.06), 0 0 0 3px rgba(108,35,112,0.08);
  }
  #tha-chat-window .chat-input::placeholder { color: #A09A94; font-size: 14px; }

  #tha-chat-window .send-btn {
    width: 38px; height: 38px;
    border: none;
    background: linear-gradient(180deg, #3a5aa7 0%, #2a4a97 40%, #6c2370 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(42,74,151,0.3), 0 1px 3px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  #tha-chat-window .send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(42,74,151,0.35), 0 2px 6px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.25);
  }
  #tha-chat-window .send-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 6px rgba(42,74,151,0.2), inset 0 2px 4px rgba(0,0,0,0.15);
  }
  #tha-chat-window .send-btn svg { width: 17px; height: 17px; }

  /* Footer */
  #tha-chat-window .chat-footer {
    text-align: center;
    padding: 0.35rem;
    font-size: 0.65rem;
    color: #A09A94;
    background: white;
    flex-shrink: 0;
  }

  /* Responsive - mobile fullscreen */
  @media (max-width: 480px) {
    #tha-chat-window {
      bottom: 0;
      right: 0;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      border-radius: 0;
      border: none;
    }
    #tha-chat-window .chat-body {
      padding: 0.85rem;
    }
    #tha-chat-window .msg-bubble {
      font-size: 15px;
      line-height: 1.6;
      padding: 0.7rem 0.95rem;
    }
    #tha-chat-window .qr-btn {
      padding: 0.55rem 1.1rem;
      font-size: 1rem;
    }
    #tha-chat-window .chat-input {
      font-size: 16px;
      min-height: 44px;
    }
    #tha-chat-window .send-btn {
      width: 44px;
      height: 44px;
    }
    #tha-chat-window .chat-input-area {
      padding: 0.6rem 0.75rem;
      padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
    }
    #tha-chat-fab { bottom: 14px; right: 14px; width: 52px; height: 52px; }
  }

  /* Tablets */
  @media (min-width: 481px) and (max-width: 768px) {
    #tha-chat-window {
      width: 360px;
      height: 480px;
      bottom: 96px;
      right: 16px;
    }
  }

/* === Hardening: hold key styles even if the theme uses !important === */
#tha-chat-window .msg-bubble p {
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit;
}
#tha-chat-window .send-btn {
  padding: 0 !important;
  width: 38px !important;
  height: 38px !important;
  color: #fff !important;
  background: linear-gradient(180deg, #3a5aa7 0%, #2a4a97 40%, #6c2370 100%) !important;
  border: none !important;
  border-radius: 12px !important;
}
#tha-chat-window .qr-btn {
  padding: 0.3rem 0.75rem !important;
  font-size: 0.73rem !important;
  color: #6c2370 !important;
  background: linear-gradient(135deg, rgba(42,74,151,0.08), rgba(108,35,112,0.08)) !important;
  border: 1.5px solid rgba(108,35,112,0.25) !important;
  border-radius: 99px !important;
  text-transform: none !important;
}
#tha-chat-window .qr-btn:hover,
#tha-chat-window .qr-btn:focus-visible {
  color: #fff !important;
  background: linear-gradient(135deg, #2a4a97, #6c2370) !important;
  border-color: transparent !important;
}
#tha-chat-window .chat-input {
  width: auto !important;
  padding: 0.55rem 0.85rem !important;
  font-size: 14px !important;
}

/* Mobile: chat is full screen, so move the close button up to the header
   instead of covering the send button. */
@media (max-width: 480px) {
  #tha-chat-window .send-btn { width: 44px !important; height: 44px !important; }
  #tha-chat-window .qr-btn { padding: 0.55rem 1.1rem !important; font-size: 1rem !important; }
  #tha-chat-window .chat-input { font-size: 16px !important; }
  #tha-chat-fab.open {
    top: 12px; bottom: auto; right: 12px;
    width: 40px; height: 40px;
    border-width: 2px;
  }
  #tha-chat-fab.open .fab-close { font-size: 1.1rem; }
  #tha-chat-window .chat-header { padding-right: 60px; }
}
