/* ============================================
   SAM CHATBOT — Industrial Theme
   ============================================ */

/* Trigger button */
.sam-chat-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 56px;
  height: 56px;
  background: #f97316;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sam-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(249, 115, 22, 0.45);
}

.sam-chat-trigger svg {
  width: 24px;
  height: 24px;
  transition: opacity 0.15s, transform 0.15s;
}

.sam-chat-trigger .icon-close { display: none; }
.sam-chat-trigger.open .icon-chat { display: none; }
.sam-chat-trigger.open .icon-close { display: block; }

/* Unread badge */
.sam-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #0d0d0d;
  display: none;
}

.sam-chat-trigger.has-unread .sam-chat-badge { display: block; }

/* Chat window */
.sam-chat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 899;
  width: 380px;
  height: 520px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}

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

/* Header */
.sam-chat-header {
  background: #0d0d0d;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.sam-chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sam-chat-avatar {
  width: 32px;
  height: 32px;
  background: #f97316;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.sam-chat-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f0ebe0;
}

.sam-chat-status {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: #888880;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.sam-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #444440;
  display: flex;
  padding: 4px;
  transition: color 0.15s;
}

.sam-chat-close:hover { color: #f0ebe0; }
.sam-chat-close svg { width: 18px; height: 18px; }

/* Messages area */
.sam-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a #1a1a1a;
}

.sam-chat-messages::-webkit-scrollbar { width: 4px; }
.sam-chat-messages::-webkit-scrollbar-track { background: #1a1a1a; }
.sam-chat-messages::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* Message bubbles */
.sam-msg {
  max-width: 85%;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.sam-msg-bot {
  align-self: flex-start;
  background: #222220;
  color: #f0ebe0;
  border-radius: 4px 4px 4px 0;
}

.sam-msg-user {
  align-self: flex-end;
  background: #f97316;
  color: #000;
  border-radius: 4px 4px 0 4px;
  font-weight: 500;
}

/* Meeting booked confirmation */
.sam-msg-meeting {
  align-self: flex-start;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #f0ebe0;
  border-radius: 4px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.sam-msg-meeting strong {
  color: #f97316;
  font-weight: 700;
}

/* Typing indicator */
.sam-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.65rem 0.9rem;
  background: #222220;
  border-radius: 4px 4px 4px 0;
  align-self: flex-start;
  max-width: 60px;
}

.sam-typing-dot {
  width: 6px;
  height: 6px;
  background: #888880;
  border-radius: 50%;
  animation: samTyping 1.2s ease-in-out infinite;
}

.sam-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.sam-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes samTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.sam-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.65rem;
  background: #0d0d0d;
  border-top: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.sam-chat-input {
  flex: 1;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 4px 0 0 4px;
  padding: 0.65rem 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #f0ebe0;
  outline: none;
  transition: border-color 0.15s;
}

.sam-chat-input::placeholder { color: #444440; }
.sam-chat-input:focus { border-color: #f97316; }

.sam-chat-send {
  background: #f97316;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.sam-chat-send:hover { background: #ea6c0a; }
.sam-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.sam-chat-send svg { width: 18px; height: 18px; }

/* ============================================
   MOBILE — full screen
   ============================================ */
@media (max-width: 480px) {
  .sam-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
  }

  .sam-chat-trigger {
    bottom: 20px;
    right: 20px;
  }
}
