/* chat widget — shipped 24.07.2026 @tom
   z-index high on purpose (cookie banner is 1500, chat above it when open)
*/

.ng-chat-root {
  --ng-chat-bg: #121a22;
  --ng-chat-panel: #162028;
  --ng-chat-border: #2a3a4c;
  --ng-chat-text: #d6dde6;
  --ng-chat-muted: #8a97a8;
  --ng-chat-accent: #a8c070;
  --ng-chat-user: #243040;
  --ng-chat-bot: #1a2430;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2400;
  font-family: "Rajdhani", sans-serif;
}

.ng-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--ng-chat-border);
  background: var(--ng-chat-accent);
  color: #0a0e12;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ng-chat-toggle:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.ng-chat-toggle[aria-expanded="true"] {
  background: #162028;
  color: var(--ng-chat-accent);
}

.ng-chat-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 120px));
  background: var(--ng-chat-bg);
  border: 1px solid var(--ng-chat-border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  pointer-events: none;
}

.ng-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ng-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ng-chat-panel);
  border-bottom: 1px solid var(--ng-chat-border);
}

.ng-chat-head h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ng-chat-text);
  font-weight: 700;
}

.ng-chat-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ng-chat-border);
  background: transparent;
  color: var(--ng-chat-text);
  cursor: pointer;
}

.ng-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ng-chat-bg);
}

.ng-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ng-chat-text);
  word-break: break-word;
}

.ng-chat-bubble a {
  color: var(--ng-chat-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ng-chat-bubble--bot {
  align-self: flex-start;
  background: var(--ng-chat-bot);
  border: 1px solid var(--ng-chat-border);
  border-bottom-left-radius: 4px;
}

.ng-chat-bubble--user {
  align-self: flex-end;
  background: var(--ng-chat-user);
  border: 1px solid #334556;
  border-bottom-right-radius: 4px;
}

.ng-chat-bubble ul {
  margin: 8px 0 0 1rem;
  padding: 0;
  list-style: disc;
}

.ng-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 12px 14px;
  background: var(--ng-chat-bot);
  border: 1px solid var(--ng-chat-border);
  border-radius: 12px;
}

.ng-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ng-chat-muted);
  animation: ngChatDot 1.1s infinite ease-in-out;
}
.ng-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ng-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

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

.ng-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ng-chat-border);
  background: var(--ng-chat-panel);
}

.ng-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--ng-chat-border);
  background: #0e151c;
  color: var(--ng-chat-text);
}

.ng-chat-send {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--ng-chat-accent);
  background: var(--ng-chat-accent);
  color: #0a0e12;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: "Orbitron", sans-serif;
}

@media (max-width: 560px) {
  .ng-chat-root {
    right: 12px;
    bottom: 12px;
  }
  .ng-chat-panel {
    position: fixed;
    inset: 8px;
    width: auto;
    height: auto;
    bottom: 8px;
    right: 8px;
    left: 8px;
    top: 8px;
    border-radius: 12px;
  }
  .ng-chat-toggle {
    /* keep launcher visible above full-screen panel close */
    z-index: 1;
  }
}
