/* ================================================
   TOAST NOTIFICATIONS MODULE
   ================================================ */

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  pointer-events: none;
}

/* Toast Base Styles */
.toast {
  background: #ffffff !important;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  pointer-events: auto;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
  position: relative;
  overflow: hidden;
}

/* Toast Show Animation */
.toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* Toast Hide Animation */
.toast.hide {
  transform: translateX(400px);
  opacity: 0;
}

/* Toast Types */
.toast.success {
  background: #ffffff !important;
  border-left-color: var(--tp-success, #10b981);
}

.toast.error {
  background: #ffffff !important;
  border-left-color: var(--tp-danger, #ef4444);
}

.toast.warning {
  background: #ffffff !important;
  border-left-color: var(--tp-warning, #f59e0b);
}

.toast.info {
  background: #ffffff !important;
  border-left-color: var(--tp-info, #3b82f6);
}

/* Toast Icon */
.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-top: 2px;
}

.toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--tp-success, #10b981);
}

.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--tp-danger, #ef4444);
}

.toast.warning .toast-icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--tp-warning, #f59e0b);
}

.toast.info .toast-icon {
  background: rgba(59, 130, 246, 0.1);
  color: var(--tp-info, #3b82f6);
}

.toast-icon i {
  font-size: 12px;
  font-weight: bold;
}

/* Toast Content */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  margin: 0 0 4px 0;
  color: var(--tp-gray-900);
}

.toast-message {
  font-size: 13px;
  line-height: 1.4;
  color: var(--tp-gray-600);
  margin: 0;
}

.toast-message a {
  color: var(--tp-primary);
  text-decoration: none;
  font-weight: 500;
}

.toast-message a:hover {
  text-decoration: underline;
}

/* Close Button */
.toast-close {
  all: unset;
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--tp-gray-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 16px;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  background: var(--tp-gray-100);
  color: var(--tp-gray-600);
}

.toast-close svg {
  width: 16px;
  height: 16px;
  color: inherit;
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  transition: width linear;
  width: 100%;
}

.toast.success .toast-progress {
  background: var(--tp-success, #10b981);
  opacity: 0.3;
}

.toast.error .toast-progress {
  background: var(--tp-danger, #ef4444);
  opacity: 0.3;
}

.toast.warning .toast-progress {
  background: var(--tp-warning, #f59e0b);
  opacity: 0.3;
}

.toast.info .toast-progress {
  background: var(--tp-info, #3b82f6);
  opacity: 0.3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: auto;
    width: 100%;
    transform: translateY(-100px);
  }

  .toast.show {
    transform: translateY(0);
  }

  .toast.hide {
    transform: translateY(-100px);
  }
}

/* Dark Mode Support - Always white background */
.dark .toast {
  background: #ffffff !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dark .toast-title {
  color: var(--tp-gray-900);
}

.dark .toast-message {
  color: var(--tp-gray-600);
}

.dark .toast-close {
  color: var(--tp-gray-400);
}

.dark .toast-close:hover {
  background: var(--tp-gray-100);
  color: var(--tp-gray-600);
}

/* Animation Keyframes */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Stacking for Multiple Toasts */
.toast:not(:last-child) {
  margin-bottom: 8px;
}

/* Hover Effects */
.toast:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.toast:hover .toast-progress {
  animation-play-state: paused;
}

/* Custom WooCommerce Integration */
.toast.woocommerce-message {
  background: #ffffff !important;
  border-left-color: var(--tp-success, #10b981);
}

.toast.woocommerce-error {
  background: #ffffff !important;
  border-left-color: var(--tp-danger, #ef4444);
}

.toast.woocommerce-info {
  background: #ffffff !important;
  border-left-color: var(--tp-info, #3b82f6);
}

/* Hide Original Flatsome Messages */
body.use-toast-notifications .message-wrapper {
  display: none !important;
}
