/* style.css - Custom styling and animations for Bear Cần Giuộc */

/* Custom premium scrollbar for modern browsers */
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #e7e5e4;
  border-radius: 99px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #d6d3d1;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* Custom layout and modal transitions */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Apply animations to components */
#cart-drawer.active .absolute.inset-0 {
  animation: fadeIn 0.2s ease-out forwards;
}

#cart-drawer.active .absolute.inset-y-0.right-0 {
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#product-modal.active,
#admin-login-modal.active,
#admin-workspace-modal.active,
#product-form-modal.active {
  animation: fadeIn 0.2s ease-out forwards;
}

#product-modal.active > div:not(.absolute),
#admin-login-modal.active > div:not(.absolute),
#admin-workspace-modal.active > div:not(.absolute),
#product-form-modal.active > div:not(.absolute) {
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Interactive card glow effect on hover */
.product-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(120, 110, 90, 0.15);
  border-color: #f59e0b;
}

/* Custom toast item animation */
.toast-item {
  animation: slideInToast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

@keyframes slideInToast {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast-item.removing {
  transform: translateX(100%);
  opacity: 0;
}

/* Custom chatbot layout elements */
#chatbot-window {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  transform-origin: bottom right;
}

#chatbot-window.hidden {
  display: none;
  transform: scale(0.85);
  opacity: 0;
}

#chatbot-window:not(.hidden) {
  display: flex;
  transform: scale(1);
  opacity: 1;
}

/* Preset star animations */
.star-btn {
  transition: transform 0.1s ease;
}

.star-btn:active {
  transform: scale(0.85);
}

/* Text marquee style or pulsing effect */
.pulsing-border {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}
