/* Widget flutuante de atendimento IA: Suporte (Decrypt TebexWeb) */
.suporte-ia-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9500;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #f3f1fa;
}

.suporte-ia-root * {
  box-sizing: border-box;
}

/* Launcher Button */
.suporte-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px 11px 13px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: linear-gradient(135deg, #1d172a 0%, #14151e 100%);
  color: #f6f4ff;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(128, 82, 229, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.suporte-launcher:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 181, 253, 0.75);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.62), 0 0 30px rgba(139, 92, 246, 0.42);
}

.suporte-launcher:focus-visible,
.suporte-send-btn:focus-visible,
.suporte-icon-btn:focus-visible,
.suporte-quick-chip:focus-visible,
.suporte-input:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 2px;
}

.suporte-launcher.is-hidden {
  display: none;
}

.suporte-launcher-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8955e8 0%, #6d3fd4 100%);
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(128, 82, 229, 0.45);
}

.suporte-launcher-label {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.suporte-launcher-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #d6c8ff;
}

.suporte-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  flex-shrink: 0;
}

.suporte-online-dot.is-offline {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* Chat Window */
.suporte-window {
  width: min(400px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.32);
  background: #12131a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), 0 0 40px rgba(128, 82, 229, 0.14);
  animation: suporteFadeUp 0.18s ease;
}

.suporte-window[hidden] {
  display: none !important;
}

@keyframes suporteFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.suporte-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1b1629 0%, #14151f 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.suporte-header-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.suporte-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8955e8 0%, #6839ce 100%);
  color: #ffffff;
  flex-shrink: 0;
}

.suporte-avatar .suporte-online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 2px solid #171422;
  width: 10px;
  height: 10px;
}

.suporte-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.suporte-title-wrap strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.suporte-status-text {
  font-size: 11px;
  color: #a9a2be;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suporte-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.suporte-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #bab4cf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.suporte-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Messages */
.suporte-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #36304a transparent;
}

.suporte-msg {
  display: flex;
  flex-direction: column;
}

.suporte-msg-user {
  align-items: flex-end;
}

.suporte-bot-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 92%;
}

.suporte-mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(137, 85, 232, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.suporte-bubble {
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.suporte-bubble-user {
  max-width: 85%;
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(135deg, #8955e8 0%, #6d3fd4 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(109, 63, 212, 0.25);
}

.suporte-bubble-bot {
  border-radius: 4px 14px 14px 14px;
  background: #1a1b26;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #eae7f5;
}

.suporte-bubble-bot strong {
  color: #ffffff;
  font-weight: 650;
}

.suporte-bubble-bot code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(167, 139, 250, 0.14);
  color: #d8cbff;
}

.suporte-bubble-bot a {
  color: #c4b5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.suporte-bubble-bot a:hover {
  color: #ffffff;
}

.suporte-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}

.suporte-typing-bubble small {
  color: #a9a2be;
  font-size: 11.5px;
  margin-left: 4px;
}

.suporte-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b99cf7;
  animation: suportePulse 1s infinite ease-in-out;
}

.suporte-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.suporte-dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes suportePulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Quick Chips */
.suporte-quick-bar {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: #14151e;
  scrollbar-width: none;
}

.suporte-quick-bar::-webkit-scrollbar {
  display: none;
}

.suporte-quick-chip {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  background: rgba(137, 85, 232, 0.1);
  color: #d6c9fb;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.suporte-quick-chip:hover {
  background: rgba(137, 85, 232, 0.24);
  border-color: rgba(167, 139, 250, 0.55);
  color: #ffffff;
}

/* Input Area */
.suporte-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #161722;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.suporte-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0e0f15;
  color: #f3f1fa;
  font-size: 13px;
  outline: none;
}

.suporte-input::placeholder {
  color: #827e96;
}

.suporte-input:focus {
  border-color: #8955e8;
}

.suporte-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(135deg, #8955e8 0%, #6d3fd4 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.suporte-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.suporte-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.suporte-footer {
  padding: 6px 12px 9px;
  background: #14151e;
  text-align: center;
  font-size: 10px;
  color: #7d7991;
}

body.uvmap-cinema-mode .suporte-ia-root,
body.sirene-cinema-mode .suporte-ia-root,
body.dumper-cinema-mode .suporte-ia-root,
.suporte-ia-root.is-page-active {
  display: none !important;
}

/* Dedicated Sidebar Category Button & Full-Panel Support View */
.sidebar .nav.support-ai-nav-highlight {
  border: 1px solid rgba(167, 139, 250, 0.42);
  background: linear-gradient(110deg, rgba(48, 32, 63, 0.72), rgba(24, 21, 34, 0.92));
  color: #e6d7ff;
  margin-top: 4px;
  margin-bottom: 6px;
}

.sidebar .nav.support-ai-nav-highlight .ui-icon {
  color: #c4b5fd;
}

.sidebar .nav.support-ai-nav-highlight.active {
  background: #613998;
  border-color: #9b76ef;
  color: #ffffff;
}

.suporte-page-shell {
  display: flex;
  flex-direction: column;
  height: min(740px, calc(100vh - 155px));
  min-height: 460px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: #12131a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

.suporte-page-shell .suporte-header {
  padding: 18px 22px;
}

.suporte-page-shell .suporte-messages {
  padding: 22px;
  gap: 14px;
}

.suporte-page-shell .suporte-bubble {
  font-size: 13.5px;
  padding: 12px 15px;
}

.suporte-page-shell .suporte-quick-bar {
  padding: 10px 20px;
  gap: 8px;
}

.suporte-page-shell .suporte-input-area {
  padding: 14px 20px;
  gap: 10px;
}

.suporte-page-shell .suporte-input {
  height: 44px;
  font-size: 13.5px;
}

.suporte-page-shell .suporte-send-btn {
  width: 44px;
  height: 44px;
}

@media (max-width: 640px) {
  .suporte-ia-root {
    right: 12px;
    bottom: 12px;
  }

  .suporte-window {
    width: calc(100vw - 24px);
    height: min(76dvh, 560px);
  }

  .suporte-page-shell {
    height: calc(100vh - 120px);
    min-height: 400px;
  }
}
