:root {
    --chat-primary-color: #26a69a; 
    --chat-secondary-color: #6759ff;
}

#ai-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font: inherit; 
}

#chat-open-button {
  width: 60px;
  height: 60px;
  background-color: var(--chat-primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, opacity 0.3s ease;
}

#chat-open-button:hover {
  transform: scale(1.1);
}

#chat-open-button.hidden {
  transform: scale(0);
  opacity: 0;
}

#chat-window {
  width: 370px;
  max-width: 90vw;
  height: 600px;
  max-height: 85vh;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#chat-window.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chat-header {
  background-color: var(--chat-primary-color);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  direction: rtl;
}

#chat-close-button {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

#chat-messages {
  flex-grow: 1;
  /* CHANGED: Reduced padding */
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  direction: rtl;
  background-color: #f9f9f9;
}

.chat-message {
  /* CHANGED: Reduced padding */
  padding: 10px 15px;
  border-radius: 20px;
  max-width: 85%;
  line-height: 1.6;
  word-wrap: break-word;
}

.user-message {
  background-color: var(--chat-primary-color);
  color: white;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.ai-message {
    background-color: #E9ECEF;
    color: #343A40;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    text-align: right;
}
.accordion-content {
    display: none;
    margin-top: 10px;
}
.read-more-btn {
    background: none;
    border: none;
    color: var(--chat-secondary-color);
    font-weight: bold;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 10px;
    display: inline-block;
}


.ai-message .source-links-container {
  margin-top: 15px;
  border-top: 1px solid #ddd;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-message .source-links-container a {
  display: block;
  background-color: #f8f9fa;
  color: var(--chat-secondary-color);
  padding: 10px 15px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  border: 1px solid #e0e0e0;
  transition: background-color 0.2s ease;
}
.ai-message .source-links-container a:hover {
  background-color: #e9ecef;
}

.quick-reply-buttons {
  padding: 10px 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quick-reply-btn {
    background-color: var(--chat-secondary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.quick-reply-btn:hover {
  opacity: 0.9;
}

#chat-input-container {
  padding: 10px 15px;
  border-top: 1px solid #ddd;
  background-color: #fff;
}

#chat-form {
  display: flex;
  gap: 10px;
}

#chat-input {
  flex-grow: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  /* CHANGED: Reduced padding */
  padding: 10px 15px;
  font-size: 14px;
  direction: rtl;
}

#chat-form button {
  /* CHANGED: Matched color and border-radius */
  background-color: var(--chat-primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
}
