/* chat-widget.css */
:root {
    --font-primary: 'Poppins', sans-serif;
    --color-primary: #004080;
    --color-bg: rgba(0, 0, 0, 0.7);
    --color-bot-bg: rgba(30, 30, 30, 0.8);
    --color-user-bg: rgba(0, 112, 192, 0.85);
    --color-text: #ffffff;
    --avatar-size: 32px;
    --modal-width: 300px;
    --modal-max-height: 55vh;
  }
  
  #chat-widget-wrapper {
    position: fixed;
    bottom: 16px;
    right: 16px;
    transform-origin: bottom right;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    z-index: 1000;
  }
  #chat-widget-wrapper.open {
    transform: scale(1);
    opacity: 1;
  }
  #chat-widget-wrapper.closing {
    transform: scale(0.2) translate(60px, 60px);
    opacity: 0;
  }
  
  .chat-btn {
    width: 56px; height: 56px;
    background: var(--color-primary);
    border-radius: 50%; border: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  }
  .chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  }
  .chat-icon { fill: #fff; width: 28px; height: 28px; }
  
  .chat-modal {
    display: none;
    position: fixed; bottom: 80px; right: 16px;
    width: var(--modal-width); max-height: var(--modal-max-height);
    background: var(--color-bg); backdrop-filter: blur(12px);
    border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow: hidden; opacity: 0; transform: scale(0.85);
    transition: transform 0.25s, opacity 0.25s;
  }
  .chat-modal.open {
    display: block; opacity: 1; transform: scale(1);
  }
  
  .chat-header {
    background: var(--color-primary); color: var(--color-text);
    padding: 12px 16px; font: 600 18px/1.2 var(--font-primary);
    display: flex; justify-content: space-between; align-items: center;
  }
  .chat-close {
    background: none; border: none;
    font-size: 24px; color: var(--color-text);
    cursor: pointer; transition: transform 0.2s;
  }
  .chat-close:hover { transform: scale(1.2) rotate(90deg); }
  
  .chat-body {
    padding: 10px;
    display: flex; flex-direction: column;
    height: calc(var(--modal-max-height) - 48px);
    overflow: hidden;
  }
  .messages {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px; padding-right: 6px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.3) transparent;
  }
  .messages::-webkit-scrollbar { width: 6px; }
  .messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3); border-radius: 3px;
  }
  
  .msg {
    display: flex; align-items: flex-start;
    font: 16px/1.5 var(--font-primary); color: var(--color-text);
    animation: fadeInUp 0.2s ease forwards;
  }
  .msg.bot { justify-content: flex-start; }
  .msg.user { justify-content: flex-end; }
  
  .avatar { width: var(--avatar-size); height: var(--avatar-size); }
  .avatar img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  }
  
  .bubble {
    max-width: 70%; padding: 10px 14px; border-radius: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
  }
  .msg.bot .bubble { background: var(--color-bot-bg); }
  .msg.user .bubble { background: var(--color-user-bg); }
  .bubble:hover { transform: translateY(-2px); }
  
  .typing-indicator {
    display: flex; gap: 4px; margin-bottom: 4px;
  }
  .typing-indicator .dot {
    width: 6px; height: 6px; background: var(--color-text);
    border-radius: 50%; opacity: 0.4; animation: blink 1.2s infinite;
  }
  .typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
  .typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
  
  .input-area {
    display: flex; padding-top: 8px;
  }
  #chatInput {
    flex: 1; padding: 10px 12px; border: none;
    border-radius: 14px 0 0 14px; outline: none;
    font: 16px var(--font-primary); color: var(--color-text);
    background: rgba(255,255,255,0.15); backdrop-filter: blur(6px);
  }
  #chatInput::placeholder { color: rgba(255,255,255,0.6); }
  
  #chatSend {
    padding: 0 16px; border: none;
    background: var(--color-primary); color: #fff;
    font: 16px var(--font-primary); border-radius: 0 14px 14px 0;
    cursor: pointer; transition: background 0.2s;
  }
  #chatSend:hover { background: var(--color-primary-light); }
  
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes blink {
    0%,80%,100% { opacity: 0.4; }
    40% { opacity: 1; }
  }
  

  /* chat-widget.css (ajuste final por aqui) */
:root {
    --font-primary: 'Poppins', sans-serif;
    --color-primary: #004080;
    --color-bg: rgba(0, 0, 0, 0.7);
    --color-bot-bg: rgba(30, 30, 30, 0.8);
    --color-user-bg: rgba(0, 112, 192, 0.85);
    --color-text: #ffffff;
    --avatar-size: 32px;
    --modal-width: 300px;
    --modal-max-height: 55vh;
  }
  
  #chat-widget-wrapper {
    position: fixed;
    bottom: 16px;
    right: 16px;
    transform-origin: bottom right;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    z-index: 1000;
  }
  #chat-widget-wrapper.open {
    transform: scale(1);
    opacity: 1;
  }
  #chat-widget-wrapper.closing {
    transform: scale(0.2) translate(60px, 60px);
    opacity: 0;
  }
  
  .chat-btn {
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    border-radius: 50%;
    border: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  }
  .chat-icon {
    fill: #fff;
    width: 28px;
    height: 28px;
  }
  
  .chat-modal {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: var(--modal-width);
    max-height: var(--modal-max-height);
    background: var(--color-bg);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.85);
    transition: transform 0.25s, opacity 0.25s;
  }
  .chat-modal.open {
    display: block;
    opacity: 1;
    transform: scale(1);
  }
  
  .chat-header {
    background: var(--color-primary);
    color: var(--color-text);
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    box-sizing: border-box;
  }
  .chat-header h2 {
    margin: 0;
    line-height: 48px;
  }
  .chat-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text);
    cursor: pointer;
    transition: transform 0.2s;
  }
  .chat-close:hover {
    transform: scale(1.2) rotate(90deg);
  }
  
  .chat-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    height: calc(var(--modal-max-height) - 48px);
    overflow: hidden;
  }
  .messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
  }
  .messages::-webkit-scrollbar {
    width: 6px;
  }
  .messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
  }
  
  .msg {
    display: flex;
    align-items: flex-start;
    font: 16px/1.5 var(--font-primary);
    color: var(--color-text);
    animation: fadeInUp 0.2s ease forwards;
  }
  .msg.bot {
    justify-content: flex-start;
  }
  .msg.user {
    justify-content: flex-end;
  }
  .avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    margin: 0 6px;
    flex-shrink: 0;
  }
  .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  
  .bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
  }
  .msg.bot .bubble {
    background: var(--color-bot-bg);
  }
  .msg.user .bubble {
    background: var(--color-user-bg);
  }
  .bubble:hover {
    transform: translateY(-2px);
  }
  
  .typing-indicator {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
  }
  .typing-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--color-text);
    border-radius: 50%;
    opacity: 0.4;
    animation: blink 1.2s infinite;
  }
  .typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
  }
  .typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
  }
  
  .input-area {
    display: flex;
    height: 40px;
  }
  #chatInput {
    flex: 1;
    padding: 0 12px;
    border: none;
    border-radius: 14px 0 0 14px;
    outline: none;
    font: 16px var(--font-primary);
    color: var(--color-text);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    margin: 0;
    box-sizing: border-box;
  }
  #chatSend {
    padding: 0 16px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font: 16px var(--font-primary);
    border-radius: 0 14px 14px 0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  #chatSend:hover {
    background: var(--color-primary-light);
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes blink {
    0%, 80%, 100% {
      opacity: 0.4;
    }
    40% {
      opacity: 1;
    }
  }
  