/* Simple Chat Widget Styles - Redesigned */
:root {
  --chat-primary-color: #003366; /* Dark blue from site */
  --chat-secondary-color: #0056b3;
  --chat-fab-color: #0056b3;
  --chat-text-light: #ffffff;
  --chat-text-dark: #333333;
  --chat-bg-light: #ffffff;
  --chat-bg-messages: #f0f2f5; /* Lighter grey for message area */
  --user-message-bg: #d1e7fd;
  --assistant-message-bg: #e9ecef;
}

/* Floating Action Button (FAB) */
#chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px; /* Increased size */
  height: 70px; /* Increased size */
  background-color: var(--chat-fab-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9998; /* Below chat window */
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

#chat-fab svg {
  stroke: var(--chat-text-light);
}

#chat-fab:hover {
  transform: scale(1.1);
}

/* Hide FAB when chat is open */
#simple-chat-widget.chat-open + #chat-fab {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

/* Chat Window */
#simple-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 370px; /* Slightly wider */
  border-radius: 12px; /* More rounded */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  background-color: var(--chat-bg-light);
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease, width 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#simple-chat-widget.chat-closed {
  height: 0;
  width: 0;
  opacity: 0;
  transform: scale(0.8) translate(50px, 50px);
  pointer-events: none;
  /* Keep box-shadow minimal when closed */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#simple-chat-widget.chat-open {
  height: 550px; /* Slightly taller */
  opacity: 1;
  transform: scale(1) translate(0, 0);
}

/* Chat Header */
#chat-header {
  background-color: var(--chat-primary-color);
  color: var(--chat-text-light);
  padding: 12px 15px;
  display: flex;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  flex-shrink: 0;
}

#chat-header svg {
  stroke: var(--chat-text-light);
}

#chat-header span {
  font-weight: 600; /* Semibold */
  font-size: 16px;
  flex-grow: 1;
  margin-left: 8px;
}

#chat-close-button {
  background: rgba(255, 255, 255, 0.2);
  color: var(--chat-text-light);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  line-height: 1;
}

#chat-close-button:hover {
  background: rgba(255, 0, 0, 0.7);
}

/* Chat Body */
#chat-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent content overflow during transition */
}

/* Chat Messages Area */
#chat-messages {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: var(--chat-bg-messages);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
  position: relative; /* For timestamp potentially */
}

.user-message {
  background-color: var(--user-message-bg);
  color: var(--chat-text-dark);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.assistant-message {
  background-color: var(--assistant-message-bg);
  color: var(--chat-text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

/* Timestamp (Placeholder - JS needs to add this) */
.message-timestamp {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
  display: block; /* Or inline-block */
  text-align: right; /* Adjust as needed */
}

/* Chat Input Area */
#chat-input-area {
  display: flex;
  padding: 12px 15px;
  border-top: 1px solid #e0e0e0;
  background-color: var(--chat-bg-light);
  flex-shrink: 0;
}

#chat-input {
  flex-grow: 1;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 20px; /* Pill shape */
  margin-right: 10px;
  font-size: 14px;
  resize: none; /* If using textarea */
  height: 40px; /* Consistent height */
  line-height: 20px;
}

#chat-input:focus {
  outline: none;
  border-color: var(--chat-secondary-color);
  box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2);
}

#chat-send-button {
  padding: 0;
  width: 40px;
  height: 40px;
  background-color: var(--chat-secondary-color);
  color: var(--chat-text-light);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

#chat-send-button svg {
  stroke: var(--chat-text-light);
  margin-left: 2px; /* Slight adjustment for centering */
}

#chat-send-button:hover {
  background-color: var(--chat-primary-color);
}

/* Responsiveness */
@media (max-width: 480px) {
  #simple-chat-widget {
    width: calc(100% - 20px);
    bottom: 10px;
    right: 10px;
    height: calc(100% - 70px); /* Adjust height for mobile */
    max-height: 550px;
  }
  #simple-chat-widget.chat-closed {
     /* Keep closed state minimal */
    height: 0;
    width: 0;
  }
  #chat-fab {
    bottom: 15px;
    right: 15px;
    width: 65px; /* Increased mobile size */
    height: 65px; /* Increased mobile size */
  }
}



/* Style for links within assistant messages */
.assistant-message a {
  color: #0056b3; /* Use the site's secondary blue color */
  text-decoration: underline;
}

.assistant-message a:hover {
  color: #003366; /* Darker blue on hover */
}

