* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", sans-serif;
  font-weight: 400;
  font-size: 100%;
  background: #f1f1f1;
}

*,
html {
  --primaryGradient: linear-gradient(93.12deg, #003366 0.52%, #003366 100%);
  --secondaryGradient: linear-gradient(268.91deg, #003366 -2.14%, #003366 99.69%);
  --primaryBoxShadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
  --secondaryBoxShadow: 0px -10px 15px rgba(0, 0, 0, 0.1);
  --primary: #003366;
}

/* CHATBOX */
.chatbox {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

/* CONTENT IS CLOSED */
.chatbox__support {
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
  width: 350px;
  height: 450px;
  z-index: -123456;
  opacity: 0;
  transition: all .5s ease-in-out;
  box-shadow: var(--primaryBoxShadow);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* CONTENT IS OPEN */
.chatbox--active {
  transform: translateY(-40px);
  z-index: 123456;
  opacity: 1;
}

/* BUTTON */
.chatbox__button {
  text-align: right;
}

.chatbox__button button {
  padding: 15px;
  background: var(--primary);
  border: none;
  outline: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--primaryBoxShadow);
  transition: all 0.3s ease;
}

.chatbox__button button:hover {
  transform: scale(1.1);
}

.send__button {
  padding: 8px 15px;
  background: var(--primary);
  color: white;
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 20px;
  transition: background 0.3s ease;
}

.send__button:hover {
  background: #004080;
}

/* HEADER */
.chatbox__header {
  background: var(--primaryGradient);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: var(--primaryBoxShadow);
}

.chatbox__image--header {
  margin-right: 10px;
}

.chatbox__heading--header {
  font-size: 1.2rem;
  color: white;
  margin: 0;
}

.chatbox__description--header {
  font-size: 0.9rem;
  color: white;
  margin: 0;
}

/* MESSAGES */
.chatbox__messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.messages__item {
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.4;
}

.messages__item--visitor {
  background: #e0e0e0;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.messages__item--operator {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

/* BUTTONS */
.message-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-width: 80%;
  align-self: flex-start;
}

.message-button {
  background: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  text-align: center;
}

.message-button:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 51, 102, 0.3);
}

/* FOOTER */
.chatbox__footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--secondaryGradient);
  box-shadow: var(--secondaryBoxShadow);
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
  gap: 10px;
}

.chatbox__footer input {
  flex: 1;
  border: none;
  padding: 10px 15px;
  border-radius: 20px;
  outline: none;
  font-size: 0.9rem;
}

.chatbox__footer input:focus {
  box-shadow: 0 0 5px rgba(0, 51, 102, 0.3);
}

/* SCROLLBAR */
.chatbox__messages::-webkit-scrollbar {
  width: 6px;
}

.chatbox__messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chatbox__messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chatbox__messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.chatbox__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}

.clear-chat-btn {
    background: #ff4b4b;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.clear-chat-btn:hover {
    background: #e64545;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .chatbox {
    bottom: 20px;
    right: 20px;
    left: 20px;
  }

  .chatbox__support {
    width: 100%;
    height: 400px;
  }
}
