html {
  --primaryGradient: linear-gradient(93.12deg, #3498db 0.52%, #3498db 100%);
  --primaryGradient2: linear-gradient(93.12deg, #e7e7e7 0.52%, #f0f0f0 100%);
  --secondaryGradient: linear-gradient(
    268.91deg,
    #3498db -2.14%,
    #3498db 99.69%
  );
  --primaryBoxShadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
  --secondaryBoxShadow: 0px -10px 15px rgba(0, 0, 0, 0.1);
  --light: 300;
  --regular: 400;
  --semiBold: 600;
  --extraLight: 300;
  --italic: 300;
  --primary: #3498db;
}

.floating-chat-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  color: #3498db;
  cursor: pointer;
  z-index: 1000;
  background: white;
  border: none;
  padding: 0;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease-in-out;
  animation: ringAndScale 2.5s infinite ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-chat-button i {
  font-size: 55px;
}

.floating-chat-button:hover {
  transform: scale(1.1);
}

.menu-options {
  position: fixed;
  bottom: 90px;
  left: 20px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 150px;
  opacity: 0;
  transform: translateY(20px);
}

.menu-item i {
  margin-right: 10px;
  font-size: 18px;
}

.menu-item span {
  font-size: 14px;
  font-weight: 500;
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.menu-item.slide-in {
  animation: slideIn 0.6s ease-in-out forwards;
}

.menu-item.slide-out {
  animation: slideOut 0.6s ease-in-out forwards;
}

.chat-popup {
  position: fixed;
  bottom: 80px;
  left: 60px;
  width: 360px;
  background: #f9f9f9;
  border-radius: 20px;
  box-shadow: var(--primaryBoxShadow);
  display: none;
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.chat-popup.closing {
  animation: fadeOut 0.3s ease-out forwards;
}

.chat-popup.active {
  display: block;
}

.chat-header {
  background: var(--primaryGradient);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: var(--primaryBoxShadow);
}

.profile {
  display: flex;
  align-items: center;
}

.profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.name {
  font-size: 1.2rem;
  color: white;
  font-weight: var(--semiBold);
  margin-left: 1px;
}

.status {
  font-size: 0.9rem;
  color: white;
  font-weight: var(--regular);
  margin-left: 1px;
}

.online-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: #28a745;
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 5px #28a745;
  border: 2px solid #fff;
  position: absolute;
  left: 49px;
  top: 46px;
}

.close-btn {
  cursor: pointer;
  font-size: 20px;
  color: white;
}

.chat-body {
  padding: 20px;
  height: 300px;
  overflow-y: auto;
  background: #f9f9f9;
}

.message {
  margin-bottom: 10px;
  padding: 8px 12px;
  max-width: 70%;
  border-radius: 20px;
  position: relative;
}

.message.admin p {
  font-size: 13px;
}

.message.customer p {
  font-size: 13px;
}

.message.admin {
  background: var(--primaryGradient);
  color: white;
  border-radius: 20px;
  margin-right: auto;
  border-top-left-radius: 20;
  border-top-right-radius: 20;
  border-bottom-left-radius: 0;
  margin-right: auto;
}

.message.customer {
  background: var(--primaryGradient2);
  border-radius: 20px;
  margin-left: auto;
  border-top-left-radius: 20;
  border-top-right-radius: 20;
  border-bottom-right-radius: 0;
  margin-left: auto;
}

.message p {
  margin: 0;
  font-size: 14px;
}

.typing-indicator {
  background-color: #e1ffc7;
  padding: 12px;
  border-radius: 20px;
  width: 60px;
  margin-bottom: 10px;
  margin-left: 3px;
  margin-top: -2px;
}

.typing-dots {
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border-radius: 50%;
  margin: 0 2px;
  animation: typing 1.4s infinite ease-in-out;
  opacity: 0;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.message .time {
  font-size: 9px;
  color: #666;
  display: block;
  text-align: right;
  margin-top: 6px;
}

.floating-warning {
  font-size: 11px;
  color: #666;
  padding: -5px 10px;
  border-radius: 5px;
  margin: 2px 50px;
  text-align: left;
  display: none;
}

.chat-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-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.chat-footer input {
  border: none;
  padding: 10px 15px;
  border-radius: 30px;
  flex: 1;
  margin-right: 10px;
  font-size: 14px;
}

.chat-footer button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

@keyframes ringAndScale {
  0% {
    transform: rotate(0) scale(1);
  }
  10% {
    transform: rotate(15deg) scale(1.1);
  }
  20% {
    transform: rotate(-15deg) scale(1.05);
  }
  30% {
    transform: rotate(10deg) scale(1.1);
  }
  40% {
    transform: rotate(-10deg) scale(1.05);
  }
  50% {
    transform: rotate(5deg) scale(1.1);
  }
  60% {
    transform: rotate(-5deg) scale(1.05);
  }
  100% {
    transform: rotate(0) scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 480px) {
  .chat-popup {
    width: 70%;
    right: 5%;
    bottom: 80px;
  }

  .chat-body {
    height: 250px;
  }

  .chat-footer input {
    padding: 8px 12px;
    font-size: 12px;
  }

  .chat-footer button {
    font-size: 18px;
  }
}

.scroll-top {
  position: fixed;
  right: 1.5rem;
  bottom: -20%;
  background: transparent !important;
  color: #3498db;
  border: none !important;
  outline: none !important;
  padding: 0;
  margin: 0;
  font-size: 1.75rem;
  z-index: 100;
  transition: all 0.3s ease;
  cursor: pointer;
  opacity: 0.7;
}

.scroll-top:hover {
  opacity: 1;
  transform: translateY(-0.25rem);
}

.show-scroll {
  bottom: 2rem;
}

.scroll-top:focus {
  box-shadow: none !important;
}

@media screen and (max-width: 768px) {
  .scroll-top {
    right: 1rem;
    font-size: 1.5rem;
  }
}
