/* ===============================
   SAM ASSISTANT MODAL OVERLAY
   =============================== */
.sam-modal-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
}

/* ===============================
   MODAL BOX
   =============================== */
.sam-modal {
  width: 380px;
  max-width: 90%;
  background: #f7f7f7;
  border-radius: 14px;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===============================
   HEADER
   =============================== */
.sam-header {
  background: #8B1E1E;
  color: white;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sam-avatar {
  background: #ffffff;
  color: #8B1E1E;
  font-weight: bold;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 8px;
}

.sam-title {
  flex-grow: 1;
  font-size: 17px;
  font-weight: bold;
}

.sam-close {
  cursor: pointer;
  font-size: 24px;
  padding: 0 8px;
}

/* ===============================
   CHAT WINDOW
   =============================== */
.sam-chat-window {
  padding: 15px;
  height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}


/* ===============================
   CHAT BUBBLES
   =============================== */
.sam-bubble {
  max-width: 78%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 15px;
  display: inline-block;
  word-wrap: break-word;
}

/* Sam (left-aligned) */
.sam-from-sam {
  background: #ffffff;
  color: #333;
  align-self: flex-start;
  border-top-left-radius: 0;
  border: 1px solid #ddd;
}

/* User (right-aligned) */
.sam-from-user {
  background: #8B1E1E;
  color: white;
  align-self: flex-end;
  margin-left: auto;
  border-top-right-radius: 0;
}

/* ===============================
   TYPING INDICATOR
   =============================== */
.sam-typing {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-left: 6px;
}

.sam-typing-dot {
  width: 8px;
  height: 8px;
  background: #888;
  border-radius: 50%;
  margin-right: 4px;
  animation: samBlink 1.2s infinite ease-in-out;
}

@keyframes samBlink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* ===============================
   INPUT AREA
   =============================== */
.sam-input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  background: #fafafa;
}

#sam-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}

#sam-input:focus {
  border-color: #8B1E1E;
}

#sam-send {
  margin-left: 8px;
  background: #8B1E1E;
  border: none;
  color: white;
  padding: 0 18px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
}

#sam-send:hover {
  background: #a72323;
}

.sam-chat-window,
#sam-messages {
  min-height: 0;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
