/* ========================================
   MINI CHATBOT WIDGET — Focal Shift
   ======================================== */

/* --- Floating button --- */
.chatbot-fab {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 99999;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    padding: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
  }
  
  .chatbot-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    background: #333;
  }
  
  .chatbot-fab svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  .chatbot-fab .chatbot-icon-close { display: none; }
  .chatbot-fab.is-open .chatbot-icon-chat { display: none; }
  .chatbot-fab.is-open .chatbot-icon-close { display: block; }
  
  /* --- Teaser bubble --- */
  .chatbot-teaser {
    position: fixed;
    right: 30px;
    bottom: 106px;
    z-index: 99998;
    background: #fff;
    border-radius: 12px 12px 4px 12px;
    padding: 12px 36px 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    max-width: 260px;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: #222;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
  }
  
  .chatbot-teaser.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  
  .chatbot-teaser-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0;
  }
  
  .chatbot-teaser-close:hover {
    opacity: 1;
  }
  
  /* --- Chat panel --- */
  .chatbot-panel {
    position: fixed;
    right: 30px;
    bottom: 106px;
    z-index: 100000;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    overflow: hidden;
  }
  
  .chatbot-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  
  /* Header */
  .chatbot-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }
  
  .chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .chatbot-header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #222;
  }
  
  .chatbot-header-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #222;
  }
  
  .chatbot-header-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #888;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    padding: 0;
  }
  
  .chatbot-header-close:hover {
    background: #f7f7f7;
  }
  
  /* Messages area */
  .chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .chatbot-msg {
    max-width: 85%;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0.02em;
    word-wrap: break-word;
    animation: chatbot-msg-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  @keyframes chatbot-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .chatbot-msg-bot {
    align-self: flex-start;
    background: #f7f7f7;
    border-radius: 12px 12px 12px 4px;
    padding: 10px 14px;
    color: #222;
  }
  
  .chatbot-msg-bot a {
    color: #222;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  
  .chatbot-msg-bot a:hover {
    color: #555;
  }
  
  .chatbot-msg-user {
    align-self: flex-end;
    background: #222;
    border-radius: 12px 12px 4px 12px;
    padding: 10px 14px;
    color: #fff;
  }
  
  /* Typing indicator */
  .chatbot-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f7f7f7;
    border-radius: 12px 12px 12px 4px;
  }
  
  .chatbot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #888;
    opacity: 0.3;
    animation: chatbot-blink 1.2s infinite;
  }
  
  .chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
  .chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
  
  @keyframes chatbot-blink {
    0%, 60%, 100% { opacity: 0.2; transform: scale(1); }
    30% { opacity: 0.6; transform: scale(1.15); }
  }
  
  /* Input bar */
  .chatbot-input-bar {
    padding: 12px 14px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: #fff;
  }
  
  .chatbot-input {
    flex: 1;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    outline: none;
    color: #222;
    background: #f7f7f7;
    transition: border-color 0.2s;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    overflow-y: auto;
  }
  
  .chatbot-input:focus {
    border-color: #222;
  }
  
  .chatbot-input::placeholder {
    color: #888;
  }
  
  .chatbot-send {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border: none;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    flex-shrink: 0;
    padding: 0;
  }
  
  .chatbot-send:hover {
    transform: scale(1.05);
  }
  
  .chatbot-send:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
  }
  
  .chatbot-send-icon {
    width: 35px;
    height: 35px;
    display: block;
    pointer-events: none;
  }
  
  /* --- Mobile --- */
  @media (max-width: 991px) {
    .chatbot-fab {
      right: 14px;
      bottom: 35px;
      width: 56px;
      height: 56px;
    }
  
    .chatbot-fab svg {
      width: 24px;
      height: 24px;
    }
  
    .chatbot-teaser {
      right: 14px;
      bottom: 103px;
      max-width: 220px;
      font-size: 14px;
    }
  
    .chatbot-panel {
      right: 14px;
      bottom: 103px;
      width: calc(100vw - 28px);
      max-width: 380px;
    }
  }
  
  @media (max-width: 500px) {
    .chatbot-panel {
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      max-width: 100%;
      height: 100%;
      max-height: 100%;
      border-radius: 0;
    }
  
    .chatbot-fab.is-open {
      display: none;
    }

    .chatbot-input {
      font-size: 16px;
    }
  }