/* ============================================================
   JT WELDING & FABRICATION — AI CHATBOT STYLES
   ============================================================ */

:root {
  --chat-primary: #ff4500;
  --chat-primary-dark: #cc3700;
  --chat-secondary: #1a6eff;
  --chat-bg: #0a0a0a;
  --chat-surface: #151515;
  --chat-surface-light: #1e1e1e;
  --chat-text: #f0efec;
  --chat-text-muted: #888;
  --chat-border: rgba(255, 69, 0, 0.15);
  --chat-radius: 20px;
  --chat-font: 'Space Grotesk', sans-serif;
  --chat-font-display: 'Anton', sans-serif;
}

/* ---- FLOATING BUTTON ---- */
.jt-chat-btn {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff4500 0%, #cc3700 100%);
  box-shadow: 0 4px 24px rgba(255, 69, 0, 0.4), 0 0 0 0 rgba(255, 69, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  animation: chatPulse 3s ease-in-out infinite;
}

.jt-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(255, 69, 0, 0.55), 0 0 0 8px rgba(255, 69, 0, 0.08);
  animation: none;
}

.jt-chat-btn:active {
  transform: scale(0.95);
}

.jt-chat-btn svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

.jt-chat-btn:hover svg {
  transform: rotate(-8deg) scale(1.05);
}

.jt-chat-btn.open svg {
  transform: rotate(90deg);
}

/* Notification badge */
.jt-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--chat-secondary);
  color: #fff;
  font-family: var(--chat-font);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(26, 110, 255, 0.4);
}

.jt-chat-badge.show {
  opacity: 1;
  transform: scale(1);
}

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(255, 69, 0, 0.4), 0 0 0 0 rgba(255, 69, 0, 0.3); }
  50% { box-shadow: 0 4px 24px rgba(255, 69, 0, 0.4), 0 0 0 12px rgba(255, 69, 0, 0); }
}

/* ---- CHAT CONTAINER ---- */
.jt-chat-container {
  position: fixed;
  bottom: 104px;
  left: 28px;
  width: 380px;
  height: 520px;
  border-radius: var(--chat-radius);
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 69, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.jt-chat-container.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* ---- HEADER ---- */
.jt-chat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.jt-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(255, 69, 0, 0.3);
}

.jt-chat-avatar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jt-chat-header-info {
  flex: 1;
  min-width: 0;
}

.jt-chat-header-name {
  font-family: var(--chat-font-display);
  font-size: 16px;
  color: var(--chat-text);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.2;
}

.jt-chat-header-status {
  font-family: var(--chat-font);
  font-size: 11px;
  color: var(--chat-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.jt-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.jt-chat-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.jt-chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.jt-chat-close svg {
  width: 16px;
  height: 16px;
  stroke: var(--chat-text-muted);
  stroke-width: 2;
  fill: none;
}

/* ---- MESSAGES AREA ---- */
.jt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.jt-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.jt-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.jt-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ---- MESSAGE BUBBLES ---- */
.jt-chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  font-family: var(--chat-font);
  font-size: 13.5px;
  line-height: 1.55;
  animation: messageIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.jt-chat-msg.bot {
  align-self: flex-start;
  background: var(--chat-surface);
  color: var(--chat-text);
  border-radius: 4px 16px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.jt-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

.jt-chat-msg a {
  color: var(--chat-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jt-chat-msg.user a {
  color: #fff;
}

.jt-chat-msg strong {
  font-weight: 600;
}

.jt-chat-msg ul, .jt-chat-msg ol {
  margin: 6px 0;
  padding-left: 18px;
}

.jt-chat-msg li {
  margin-bottom: 3px;
}

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

/* ---- TYPING INDICATOR ---- */
.jt-chat-typing {
  align-self: flex-start;
  padding: 14px 20px;
  background: var(--chat-surface);
  border-radius: 4px 16px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  gap: 5px;
  align-items: center;
  animation: messageIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.jt-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chat-text-muted);
  animation: typingDot 1.4s ease-in-out infinite;
}

.jt-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.jt-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* ---- QUICK BUTTONS ---- */
.jt-chat-quick {
  padding: 8px 16px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.jt-chat-quick-btn {
  font-family: var(--chat-font);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--chat-border);
  background: transparent;
  color: var(--chat-text);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.jt-chat-quick-btn:hover {
  background: var(--chat-primary);
  border-color: var(--chat-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

/* ---- INPUT AREA ---- */
.jt-chat-input-area {
  padding: 12px 14px;
  border-top: 1px solid var(--chat-border);
  background: var(--chat-surface);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.jt-chat-textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--chat-font);
  font-size: 13.5px;
  color: var(--chat-text);
  line-height: 1.4;
  max-height: 80px;
  min-height: 20px;
  padding: 0;
}

.jt-chat-textarea::placeholder {
  color: var(--chat-text-muted);
}

.jt-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--chat-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.jt-chat-send:hover {
  background: var(--chat-primary-dark);
  transform: scale(1.08);
}

.jt-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.jt-chat-send svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* ---- POWERED BY ---- */
.jt-chat-powered {
  text-align: center;
  padding: 6px;
  font-family: var(--chat-font);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
  background: var(--chat-surface);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .jt-chat-container {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }

  .jt-chat-container.open {
    transform: scale(1) translateY(0);
  }

  .jt-chat-btn {
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
  }

  .jt-chat-btn svg {
    width: 28px;
    height: 28px;
  }
}
