@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=swap");

/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --chat-primary: #c6ab63;
  --chat-primary-hover: #b99a54;
  --chat-window-width: 410px;
  --chat-window-height: 570px;
  --chat-window-radius: 20px;
  --chat-offset-desktop: 20px;
  --chat-toggle-size: 210px;
  --chat-bubble-label: "Camilinha:";
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: #ffffff;
  color: #000000;
}

body {
  overflow-x: hidden;
  position: relative;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 20px;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

/* ================= MOCKUP DO SITE PARA TESTES ================= */
.print-site {
  width: 100%;
  min-height: 100vh;
  background: #f3f3f3;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.print-site img {
  display: block;
  width: min(100%, 1440px);
  height: auto;
}

/* ================= BOTÃO FLUTUANTE ================= */
.chat-toggle {
  position: fixed;
  right: var(--chat-offset-desktop);
  bottom: 0;
  cursor: pointer;
  z-index: 999;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-family: "Quicksand", sans-serif;
}

.chat-toggle img {
  width: var(--chat-toggle-size);
  height: auto;
  display: block;
  transition: transform 0.2s ease;
}

.chat-toggle:hover img,
.chat-toggle:hover .toggle-bubble {
  transform: scale(1.05);
}

.toggle-bubble {
  position: absolute;
  right: 132px;
  top: -5px;
  z-index: 10;
  background: #ffffff;
  color: #000000;
  padding: 8px 14px;
  border-radius: 20px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  transition: transform 0.2s ease;
  transform-origin: right bottom;
}

.toggle-bubble strong {
  font-weight: 800;
}

/* ================= JANELA DO CHAT ================= */
.chat-container {
  position: fixed;
  right: var(--chat-offset-desktop);
  bottom: 30px;
  width: var(--chat-window-width);
  max-width: 90%;
  height: var(--chat-window-height);
  background: #fafafa;
  border-radius: var(--chat-window-radius);
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.11);
  z-index: 9999;
  animation: fadeInUp 0.3s ease;
  font-family: "Quicksand", sans-serif;
}

@keyframes fadeInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.minimize-handle {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
  background: transparent;
  border: 0;
  padding: 0;
}

.minimize-handle:hover {
  transform: translateX(-50%) scale(1.05);
}

.minimize-handle img {
  width: 155px;
  height: auto;
  display: block;
}

.chat-header {
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.chat-header-image {
  display: block;
  width: 100%;
  height: auto;
  border-top-left-radius: var(--chat-window-radius);
  border-top-right-radius: var(--chat-window-radius);
}

.chat-header-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.chat-menu-toggle {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.8;
  transition: 0.2s;
  background: transparent;
  border: 0;
  color: #ffffff;
  padding: 4px;
}

.chat-menu-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

.chat-menu {
  display: none;
  position: absolute;
  top: 30px;
  right: 0;
  background: #ffffff;
  color: #333333;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 100;
  min-width: 120px;
}

.chat-menu.show {
  display: block;
}

.chat-menu button {
  width: 100%;
  padding: 12px 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
}

.chat-menu button:hover {
  background: #f4f4f4;
}

/* ================= MENSAGENS ================= */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.message {
  width: fit-content;
  max-width: 100%;
  background: #ffffff;
  padding: 10px 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  font-size: 14px;
  position: relative;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.bot {
  border: 1px solid #cccccc;
  margin-top: 25px;
  line-height: 1.5;
}

.message.bot::before {
  content: var(--chat-bubble-label);
  position: absolute;
  top: -22px;
  left: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #8a8a8a;
}

.message.user {
  background: var(--chat-primary);
  color: #ffffff;
  border: none;
  margin-left: auto;
  margin-right: 0;
  max-width: 85%;
  border-radius: 20px;
  border-bottom-right-radius: 5px;
  padding: 12px 18px;
  text-align: left;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.quick-actions button {
  background: var(--chat-primary);
  color: #ffffff;
  border: none;
  padding: 8px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
}

.quick-actions button:hover {
  background: var(--chat-primary-hover);
}

/* ================= INPUT ================= */
.chat-footer {
  display: flex;
  align-items: flex-end;
  padding: 10px;
  border-top: 1px solid #dddddd;
}

.input-label {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  margin: -4px 6px 9px 0;
}

.chat-footer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 80px;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid #cccccc;
  font-size: 14px;
  resize: none;
  outline: none;
  overflow: hidden;
  line-height: 1.4;
}

.chat-footer textarea:focus {
  border-color: var(--chat-primary);
}

.chat-footer button {
  margin-left: 8px;
  background: var(--chat-primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  padding: 0 0 0 3px;
}

.chat-footer button:hover {
  background: var(--chat-primary-hover);
}

.powered-by {
  text-align: center;
  font-size: 11px;
  color: #b3b3b3;
  padding-bottom: 10px;
}

/* ================= RESPONSIVO ================= */
@media (max-width: 767px) {
  .chat-toggle {
    right: -20px;
  }

  .chat-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    min-height: -webkit-fill-available !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  .chat-header,
  .chat-header-image {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
  }

  .minimize-handle {
    top: -7px !important;
  }

  .message {
    font-size: 16px !important;
  }

  .message.bot::before {
    font-size: 14px !important;
    top: -24px !important;
  }

  .quick-actions button {
    font-size: 14px !important;
    padding: 10px 14px !important;
  }

  .chat-header-actions {
    top: 10px !important;
    right: 10px !important;
  }

  .chat-menu-toggle {
    font-size: 26px !important;
    padding: 10px !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .chat-container {
    width: 420px !important;
    height: 600px !important;
    right: 30px !important;
    bottom: 30px !important;
    border-radius: 20px !important;
  }

  .message {
    font-size: 15px !important;
  }

  .quick-actions button {
    font-size: 13px !important;
    padding: 10px 12px !important;
  }

  .chat-menu-toggle {
    font-size: 22px !important;
    padding: 8px !important;
  }
}
