@import url(corporate_colors.css);

body {
    font-family: Arial, sans-serif;
    background-color: var(--page-bg);
}

.chatbox {
    width: min(96%, var(--content-width));
    margin: 16px auto 0;
    padding: 18px;
    border: 1px solid lightgray;
    border-radius: var(--radius);
    background-color: var(--surface);
    box-sizing: border-box;
}

.chatbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.chatbox-header .dropdown {
    position: relative;
}

.chatbox-header .dropdown select {
    min-width: 180px;
}

.chatbox-history {
    width: 100%;
    height: 500px;
    overflow-y: auto;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 8px;
    box-sizing: border-box;
    background-color: var(--surface-muted);
}

.chatbox-message-entry {
    display: flex;
    gap: 12px;
}

.chatbox-message-entry input[type="text"] {
    flex: 1;
    margin-right: 0;
}

.chatbox-message-entry button {
    min-width: 120px;
    border: 1px solid #9fb3d8;
    background-color: var(--light-blue);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
}

.user_msg {
    background-color: #eef3ff;
    padding: 12px 16px;
    word-wrap: break-word;
    max-width: min(72ch, 70%);
    justify-self: right;
    border-radius: 14px;
    border: 1px solid #c5d3ee;
    color: var(--text);
    text-align: left;
    margin-left: auto;
    margin-bottom: 12px;
}

.warning-banner {
    width: 98vw;
    max-width: none;
    margin: clamp(14px, 1.4vw, 22px) auto 0;
    background-color: #fff4d8;
    color: #8a2d00;
    text-align: center;
    padding: clamp(14px, 1.2vw, 22px) clamp(18px, 1.8vw, 28px);
    font-weight: bold;
    font-size: clamp(1.05rem, 0.6vw + 0.9rem, 1.3rem);
    line-height: 1.35;
    border: 1px solid #f2cc72;
    border-radius: var(--radius);
    box-sizing: border-box;
}

/* Style for the chatbot message box */
.chatbot_msg {
  background-color: white;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 16px;
  margin-bottom: 10px;
  max-width: min(72ch, 70%);
  word-wrap: break-word;
  color: var(--text);
  display: block;
  line-height: 1.5em;
  text-align: left;
}

#loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--dark-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

.good_connection {
  max-width: 50%;
  width: fit-content;
  background-color: #e8f7e4;
  border: 1px solid #9bc79b;
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  margin-right: 20px;
  justify-self: right;
}

.bad_connection {
  width: fit-content;
  background-color: #fde7e7;
  border: 1px solid #e2a8a8;
  border-radius: 14px;
  padding: 10px;
  margin-right: 20px;
  justify-self: right;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
}
 /* Feedback error toast */
 .feedback-error-info {
     background-color: #ffdddd;
     color: #a00;
     padding: 5px 10px;
     border: 1px solid #a00;
     border-radius: 4px;
     font-size: 0.9em;
     display: none;
 }
 .feedback-error-info.show {
     display: block;
 }

@media (max-width: 900px) {
    .warning-banner {
        width: calc(100vw - 16px);
    }

    .chatbox {
        width: calc(100% - 24px);
    }

    .chatbox-header,
    .chatbox-message-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .chatbot_msg,
    .user_msg {
        max-width: 100%;
    }
}
