/* Run Direct AI recruiting assistant — rule-based chat widget */

.rd-chat-launcher {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  width: 62px;
  height: 62px;
  border-radius: var(--radius-full);
  background: var(--rd-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border: none;
}
.rd-chat-launcher:hover {
  background: var(--rd-blue-hover);
  transform: translateY(-2px);
}
.rd-chat-launcher svg {
  width: 26px;
  height: 26px;
}
.rd-chat-launcher .rd-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: #e0393e;
  border: 2px solid #fff;
}
.rd-chat-launcher.is-hidden {
  display: none;
}

.rd-chat-panel {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  width: min(380px, calc(100vw - 2 * var(--space-4)));
  max-height: min(640px, calc(100vh - 2 * var(--space-6)));
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-divider);
}
.rd-chat-panel.is-open {
  display: flex;
}

.rd-chat-header {
  background: var(--rd-black);
  color: #fff;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.rd-chat-header__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.rd-chat-header__title .dot {
  width: 9px;
  height: 9px;
  background: #3ddc84;
  border-radius: 50%;
  flex-shrink: 0;
}
.rd-chat-header__title strong {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  display: block;
}
.rd-chat-header__title span {
  font-size: var(--text-xs);
  color: #b7bfca;
}
.rd-chat-close {
  color: #fff;
  padding: var(--space-1);
  font-size: 20px;
  line-height: 1;
}

.rd-chat-disclosure {
  background: #f6f7f9;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}

.rd-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: #fafbfc;
}

.rd-msg {
  max-width: 88%;
  font-size: var(--text-sm);
  line-height: 1.5;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
}
.rd-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--color-divider);
  color: var(--color-text);
  border-bottom-left-radius: var(--space-1);
}
.rd-msg--user {
  align-self: flex-end;
  background: var(--rd-blue);
  color: #fff;
  border-bottom-right-radius: var(--space-1);
}

.rd-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-self: flex-start;
  max-width: 100%;
}

.rd-chip {
  border: 1.5px solid var(--rd-blue);
  color: var(--rd-blue);
  background: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}
.rd-chip:hover {
  background: var(--rd-blue);
  color: #fff;
}

.rd-chat-footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-3) var(--space-5);
  display: flex;
  gap: var(--space-3);
  background: #fff;
}

.rd-chat-footer a {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--rd-blue);
  text-decoration: none;
}

@media (max-width: 480px) {
  .rd-chat-panel {
    right: var(--space-3);
    bottom: var(--space-3);
    left: var(--space-3);
    width: auto;
  }
  .rd-chat-launcher {
    right: var(--space-4);
    bottom: var(--space-4);
  }
}
