/* FLOAT BUTTON */
#chat-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #396389;
  color: #fff;
  padding: 15px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  z-index: 999 !important;
}

#chat-box {
  max-height: 90vh;
}

/* CHAT BOX */
#chat-box {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 320px;
  background: #ffffff !important;
  border-radius: 10px;
  display: none;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  font-family: Arial;
  z-index: 999 !important;
}

/* HEADER */
.chat-header {
  background: rgb(76, 175, 80) !important;
  color: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
}

/* BODY */
#chat-body {
  padding: 10px;
  max-height: 350px;
  overflow-y: auto;
}

.bot-msg p {
  background: #f1f1f1;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 5px;
}

/* OPTIONS */
.options button {
  width: 100%;
  margin: 5px 0;
  padding: 10px;
  border: none;
  background: #e9ecef;
  cursor: pointer;
  border-radius: 5px;
  text-align: left;
}

.options button:hover {
  background: #28a745;
  color: #fff;
}

/* INPUT */
.user-input {
  margin-top: 10px;
}

.user-input input {
  width: 100%;
  padding: 8px;
  margin-bottom: 5px;
}

.user-input button {
  width: 100%;
  padding: 8px;
  background: #28a745;
  color: #fff;
  border: none;
}

@media (max-width: 768px) {
  #chat-btn {
    bottom: 70px;
    /* move above footer/buttons */
    right: 15px;
  }

  #chat-box {
    bottom: 130px;
    /* prevent overlap */
    right: 10px;
    width: 90%;
  }
}

@media (max-width: 480px) {
  #chat-box {
    width: 95%;
    right: 2.5%;
    max-height: 70vh;
    /* prevents covering full screen */
  }

  #chat-body {
    max-height: 50vh;
  }
}

#chat-box {
  overflow: hidden !important;
}

@media (max-width: 768px) {
  #chat-btn {
    right: 20px;
    bottom: 80px !important;
  }
}

#chat-btn {
  position: fixed;
  bottom: 184px;
  right: 20px;
  z-index: 999;
  cursor: pointer;
}

/* MAIN BUTTON */
.chat-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #005caa, #005caa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: pulse 2s infinite;
  transition: 0.3s;
}

/* HOVER EFFECT */
.chat-icon:hover {
  transform: scale(1.1);
}

/* PULSE ANIMATION */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.6);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(108, 99, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0);
  }
}

/* TOOLTIP */
.chat-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  opacity: 0;
  white-space: nowrap;
  transition: 0.3s;
}

/* SHOW TOOLTIP */
#chat-btn:hover .chat-tooltip {
  opacity: 1;
}

/* CHAT BOX */
#chat-box {
  position: fixed;
  bottom: 40px;
  right: 20px;
  width: 396px;
  height: 400px;
  background: #f5f5f5;
  border-radius: 15px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-family: Arial;
}

/* HEADER */
.chat-header {
  background: rgb(76, 175, 80) !important;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h4 {
  margin: 0;
}

.chat-header span {
  cursor: pointer;
  font-size: 18px;
}

/* BODY */
#chat-body {
  padding: 15px;
  overflow-y: auto;
  flex: 1;
}

/* MESSAGE BUBBLE */
.bot-msg {
  background: #fff;
  padding: 12px;
  border-radius: 15px;
  margin-bottom: 10px;
  max-width: 85%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-msg {
  background: #c9a227;
  color: #fff;
  padding: 10px;
  border-radius: 15px;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-left: auto;
  max-width: 75%;
}

.options {
  background: linear-gradient(180deg, #f7f7f7 0%, #ececec 100%);
  padding: 16px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid #e4e4e4;
}

.options button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 10px 0;
  border-radius: 14px;
  border: 1px solid #dddddd;
  background: #ffffff;
  color: #222;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.options button i {
  min-width: 18px;
  font-size: 25px;
  color:  #4CAF50;
  transition: all 0.3s ease;
}

.options button:hover {
  background: linear-gradient(90deg, #c0800a, #c9a227);
  color: #fff;
  border-color:  #4CAF50;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(159, 129, 20, 0.25);
}

.options button:hover i {
  color: #fff;
}

.options button:active {
  transform: translateY(0);
}

@media (max-width: 1199px) {
  #chat-box {
    width: 400px;
    height: 400px;
    right: 18px;
    bottom: 30px;
  }

  .chat-tooltip {
    right: 62px;
    font-size: 11px;
    padding: 6px 10px;
  }
}

@media (max-width: 991px) {
  #chat-box {
    width: 360px;
    height: 380px;
    right: 16px;
    bottom: 20px;
    border-radius: 14px;
  }

  .chat-header {
    padding: 12px 14px;
  }

  .chat-header h4 {
    font-size: 15px;
  }

  .chat-header span {
    font-size: 17px;
  }

  #chat-body {
    padding: 14px;
  }

  .bot-msg,
  .user-msg {
    font-size: 14px;
    line-height: 1.5;
  }

  .bot-msg {
    max-width: 88%;
  }

  .user-msg {
    max-width: 80%;
  }

  .options {
    padding: 14px;
    border-radius: 16px;
  }

  .options button {
    padding: 13px 14px;
    font-size: 13px;
    gap: 10px;
  }

  .options button i {
    font-size: 20px;
  }
}

@media (max-width: 767px) {
  .chat-tooltip {
    display: none;
  }

  #chat-box {
    width: calc(100% - 24px);
    height: 70vh;
    max-height: 520px;
    right: 12px;
    left: 12px;
    bottom: 12px;
    border-radius: 14px;
  }

  .chat-header {
    padding: 12px;
  }

  .chat-header h4 {
    font-size: 14px;
  }

  .chat-header span {
    font-size: 16px;
  }

  #chat-body {
    padding: 12px;
  }

  .bot-msg {
    padding: 10px 12px;
    font-size: 13px;
    max-width: 90%;
  }

  .user-msg {
    padding: 10px 12px;
    font-size: 13px;
    max-width: 82%;
  }

  .options {
    padding: 12px;
    border-radius: 14px;
  }

  .options button {
    padding: 12px 13px;
    font-size: 13px;
    border-radius: 12px;
    gap: 10px;
    margin: 8px 0;
  }

  .options button i {
    font-size: 18px;
    min-width: 16px;
  }

  .user-input input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .user-input button {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 575px) {
  #chat-box {
    width: calc(100% - 16px);
    height: 58vh;
    /* better height */
    right: 8px;
    left: 8px;
    bottom: 29px;
    /* FIXED */
    border-radius: 12px;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .chat-header h4 {
    font-size: 13px;
  }

  #chat-body {
    padding: 10px;
  }

  .bot-msg,
  .user-msg {
    font-size: 12px;
    line-height: 1.4;
    border-radius: 12px;
  }

  .bot-msg {
    max-width: 92%;
  }

  .user-msg {
    max-width: 85%;
  }

  .options {
    padding: 10px;
    border-radius: 12px;
  }

  .options button {
    padding: 11px 12px;
    font-size: 12px;
    border-radius: 10px;
    gap: 8px;
  }

  .options button i {
    font-size: 16px;
  }

  .user-input {
    margin-top: 8px;
  }

  .user-input input {
    padding: 9px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  .user-input button {
    padding: 9px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  .typing {
    gap: 4px;
    padding: 8px;
  }

  .typing span {
    width: 7px;
    height: 7px;
  }

  .badge {
    font-size: 9px;
    padding: 2px 5px;
    top: -4px;
    right: -4px;
  }
}

@media (max-width: 380px) {
  #chat-box {
    width: calc(100% - 12px);
    left: 6px;
    right: 6px;
    bottom: 29px;
    height: 58vh;
    border-radius: 10px;
  }

  .chat-header h4 {
    font-size: 12px;
  }

  .bot-msg,
  .user-msg {
    font-size: 11px;
  }

  .options button {
    font-size: 11px;
    padding: 10px;
  }

  .options button i {
    font-size: 15px;
  }

  .user-input input,
  .user-input button {
    font-size: 11px;
  }
}

@media (max-width: 575px) {
  .options {
    padding: 12px;
    border-radius: 14px;
  }

  .options button {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 12px;
    gap: 10px;
  }

  .options button i {
    font-size: 15px;
  }
}

/* INPUT */
.user-input {
  margin-top: 10px;
}

.user-input input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 5px;
}

.user-input button {
  width: 100%;
  padding: 10px;
  background: #50451d;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* TYPING ANIMATION */
.typing {
  display: flex;
  gap: 5px;
  padding: 10px;
}

.typing span {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: bounce 1.5s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #005caa;
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 50%;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}
