/* Chat Widget Styles — Industrial */
.chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: none;
}

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: "JetBrains Mono", "IBM Plex Mono", "Fira Code", "Courier New", monospace;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: var(--primary);
  border: 1px solid var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.chat-toggle:hover {
  background: var(--primary-dark);
}

.chat-toggle svg {
  width: 24px;
  height: 24px;
  fill: var(--darker);
  transition: transform 0.2s;
}

.chat-toggle.active svg {
  transform: rotate(90deg);
}

.chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--dark);
  border-radius: 0;
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

.chat-window.open {
  display: flex;
}

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

.chat-window-header {
  padding: 16px 20px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: var(--darker);
  border: 1px solid var(--border);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
}

.chat-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chat-info span {
  font-size: 0.7rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 0;
  animation: blink-dot 2s infinite step-end;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

.chat-messages-container::-webkit-scrollbar-thumb {
  background: var(--border);
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: fadeIn 0.2s ease;
}

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

.chat-message.user {
  background: var(--primary);
  color: var(--darker);
  align-self: flex-end;
  border: 1px solid var(--primary);
}

.chat-message.bot {
  background: var(--surface);
  color: var(--light);
  align-self: flex-start;
  border: 1px solid var(--border);
}

.chat-message.bot.typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
}

.chat-message.bot.typing span {
  width: 6px;
  height: 6px;
  background: var(--gray);
  border-radius: 0;
  animation: typingBlink 1s infinite step-end;
}

.chat-message.bot.typing span:nth-child(2) {
  animation-delay: 0.33s;
}

.chat-message.bot.typing span:nth-child(3) {
  animation-delay: 0.66s;
}

@keyframes typingBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.chat-message .timestamp {
  font-size: 0.65rem;
  opacity: 0.5;
  margin-top: 5px;
  display: block;
  text-transform: uppercase;
}

.chat-message a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

.chat-message a:hover {
  color: var(--light);
}

.chat-message.user a {
  color: var(--darker);
  text-decoration: underline;
}

.chat-input-container {
  padding: 0;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0;
  background: var(--surface);
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--darker);
  color: var(--light);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}

.chat-input:focus {
  background: var(--dark);
}

.chat-input::placeholder {
  color: var(--gray);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.chat-send {
  width: 44px;
  height: auto;
  border-radius: 0;
  background: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-send:hover {
  background: var(--primary-dark);
}

.chat-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.chat-send svg {
  width: 18px;
  height: 18px;
  fill: var(--darker);
  pointer-events: none;
}

/* Welcome message */
.welcome-message {
  text-align: center;
  padding: 20px;
  color: var(--gray);
}

.welcome-message h5 {
  color: var(--light);
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.welcome-message p {
  font-size: 0.8rem;
  line-height: 1.6;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
  justify-content: center;
}

.quick-action {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--light);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.quick-action:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--darker);
}

/* Responsive */
@media (max-width: 640px) {
  .chat-widget {
    bottom: 15px;
    right: 15px;
    left: 15px;
  }

  .chat-toggle {
    width: 50px;
    height: 50px;
    position: fixed;
    right: 15px;
    bottom: 10px;
    left: auto;
  }

  .chat-window {
    width: calc(100vw - 30px);
    height: calc(100vh - 100px);
    max-height: 600px;
    bottom: 70px;
    right: 0;
    left: 0;
    margin: 0 auto;
  }
}

@media (max-width: 380px) {
  .chat-toggle {
    width: 48px;
    height: 48px;
    right: 10px;
  }

  .chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 90px);
    max-height: 500px;
    bottom: 65px;
  }
}
