/**
 * Toast Notifications - Usit Holidays
 * Fixed position notifications with auto-dismiss
 */

/* Toast container - fixed bottom-right */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 400px;
}

/* Toast notification */
.toast {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 300px;
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: all var(--transition-base);
  border-left: 4px solid;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Toast types */
.toast-success {
  border-left-color: var(--success-green);
}

.toast-error {
  border-left-color: var(--error-red);
}

.toast-warning {
  border-left-color: var(--warning-orange);
}

.toast-info {
  border-left-color: var(--info-blue);
}

/* Toast icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-center;
}

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

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-red);
}

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

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

.toast-icon svg {
  width: 16px;
  height: 16px;
}

/* Toast content */
.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: var(--font-semibold);
  color: var(--text-dark);
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.toast-message {
  color: var(--text-gray);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Toast close button */
.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--text-gray);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  background: currentColor;
  transition: width linear;
}

.toast-success .toast-progress-bar {
  background: var(--success-green);
}

.toast-error .toast-progress-bar {
  background: var(--error-red);
}

.toast-warning .toast-progress-bar {
  background: var(--warning-orange);
}

.toast-info .toast-progress-bar {
  background: var(--info-blue);
}

/* Mobile responsive */
@media (max-width: 640px) {
  #toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    max-width: none;
  }

  .toast {
    min-width: auto;
  }
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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