
/* =========================================
   ASISTEN TANMIYA - CHATBOT
   BPR Syariah Tanmiya Artha
========================================= */

:root {
    --chat-green-dark: #0C3B2A;
    --chat-green: #16845A;
    --chat-green-light: #24B982;
    --chat-mint: #EAF8F1;
    --chat-text: #26352E;
    --chat-muted: #718078;
    --chat-white: #FFFFFF;
    --chat-shadow: 0 18px 55px rgba(12, 59, 42, 0.18);
  }
  
  /* Floating launcher */
  .tanmiya-chat-launcher {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99990;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-green), var(--chat-green-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(22, 132, 90, 0.35);
    transition: transform .25s ease, box-shadow .25s ease;
    animation: tanmiya-chat-pulse 2.8s infinite;
  }
  
  .tanmiya-chat-launcher:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 12px 30px rgba(22, 132, 90, 0.42);
  }
  
  .tanmiya-chat-launcher i {
    font-size: 27px;
  }
  
  .tanmiya-chat-launcher .chat-launcher-close {
    display: none;
  }
  
  .tanmiya-chat-launcher.is-open .chat-launcher-icon {
    display: none;
  }
  
  .tanmiya-chat-launcher.is-open .chat-launcher-close {
    display: inline-block;
  }
  
  @keyframes tanmiya-chat-pulse {
    0%, 100% {
      box-shadow: 0 8px 25px rgba(22, 132, 90, .32),
                  0 0 0 0 rgba(36, 185, 130, .25);
    }
    50% {
      box-shadow: 0 8px 25px rgba(22, 132, 90, .32),
                  0 0 0 12px rgba(36, 185, 130, 0);
    }
  }
  
  /* Chat window */
  .tanmiya-chat-window {
    position: fixed;
    right: 25px;
    bottom: 105px;
    z-index: 99991;
    width: 370px;
    max-width: calc(100vw - 30px);
    height: 535px;
    max-height: calc(100dvh - 130px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--chat-white);
    border: 1px solid rgba(12, 59, 42, .08);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  }
  
  .tanmiya-chat-window.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
  
  /* Header */
  .tanmiya-chat-header {
    min-height: 78px;
    padding: 15px 17px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    background: linear-gradient(120deg, var(--chat-green-dark), var(--chat-green));
  }
  
  .tanmiya-chat-avatar {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    font-size: 20px;
  }
  
  .tanmiya-chat-heading {
    flex: 1;
    min-width: 0;
  }
  
  .tanmiya-chat-heading strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
  }
  
  .tanmiya-chat-heading span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
  }
  
  .tanmiya-chat-header button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    transition: background .2s ease;
  }
  
  .tanmiya-chat-header button:hover {
    background: rgba(255, 255, 255, .25);
  }
  
  /* Message area */
  .tanmiya-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 14px;
    background: #F7FBF8;
    scroll-behavior: smooth;
  }
  
  .tanmiya-chat-messages::-webkit-scrollbar {
    width: 5px;
  }
  
  .tanmiya-chat-messages::-webkit-scrollbar-thumb {
    background: #C8DED2;
    border-radius: 10px;
  }
  
  .tanmiya-chat-row {
    display: flex;
    margin-bottom: 13px;
  }
  
  .tanmiya-chat-row.user {
    justify-content: flex-end;
  }
  
  .tanmiya-chat-bubble {
    max-width: 85%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }
  
  .tanmiya-chat-row.bot .tanmiya-chat-bubble {
    color: var(--chat-text);
    background: #fff;
    border: 1px solid #E7EFEA;
    border-bottom-left-radius: 4px;
  }
  
  .tanmiya-chat-row.user .tanmiya-chat-bubble {
    color: #fff;
    background: var(--chat-green);
    border-bottom-right-radius: 4px;
  }
  
  .tanmiya-chat-time {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    opacity: .65;
    text-align: right;
  }
  
  /* Quick questions */
  .tanmiya-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 12px;
    background: #F7FBF8;
  }
  
  .tanmiya-chat-quick button {
    padding: 7px 10px;
    border: 1px solid #BBDCCB;
    border-radius: 20px;
    background: #fff;
    color: var(--chat-green-dark);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: .2s ease;
  }
  
  .tanmiya-chat-quick button:hover {
    background: var(--chat-mint);
    border-color: var(--chat-green);
  }
  
  /* Input */
  .tanmiya-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #E8F0EB;
    background: #fff;
  }
  
  .tanmiya-chat-form input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    border: 1px solid #DCE9E0;
    border-radius: 22px;
    outline: none;
    color: var(--chat-text);
    background: #F8FBF9;
    font-family: inherit;
    font-size: 12px;
  }
  
  .tanmiya-chat-form input:focus {
    border-color: var(--chat-green);
    box-shadow: 0 0 0 3px rgba(22, 132, 90, .09);
  }
  
  .tanmiya-chat-form button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 50%;
    background: var(--chat-green);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    transition: .2s ease;
  }
  
  .tanmiya-chat-form button:hover {
    background: var(--chat-green-dark);
    transform: scale(1.04);
  }
  
  /* WhatsApp handoff */
  .tanmiya-chat-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    padding: 8px 12px;
    border-radius: 20px;
    background: #E5F8EC;
    color: #08783D;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: .2s ease;
  }
  
  .tanmiya-chat-whatsapp:hover {
    background: #CFF1DC;
  }
  
  /* Footer note */
  .tanmiya-chat-footer {
    padding: 7px 10px;
    color: #89958D;
    background: #fff;
    text-align: center;
    font-size: 9px;
  }
  
  /* Mobile */
  @media (max-width: 600px) {
    .tanmiya-chat-launcher {
      right: 17px;
      bottom: 17px;
      width: 58px;
      height: 58px;
    }
  
    .tanmiya-chat-window {
      right: 10px;
      bottom: 85px;
      width: calc(100vw - 20px);
      height: min(560px, calc(100dvh - 110px));
      max-height: calc(100dvh - 110px);
      border-radius: 17px;
    }
  
    .tanmiya-chat-header {
      min-height: 70px;
    }
  
    .tanmiya-chat-bubble {
      font-size: 12px;
    }
  }
  
  @media (prefers-reduced-motion: reduce) {
    .tanmiya-chat-launcher {
      animation: none;
    }
  
    .tanmiya-chat-window,
    .tanmiya-chat-launcher,
    .tanmiya-chat-form button {
      transition: none;
    }
  }
  