/* ================================
   TOAST NOTIFICATION SYSTEM
   ================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  padding: 16px 20px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: all;
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
}

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

.toast.hide {
  opacity: 0;
  transform: translateX(400px);
}

/* Toast Types */
.toast.success {
  border-left-color: #28a745;
}

.toast.error {
  border-left-color: #dc3545;
}

.toast.warning {
  border-left-color: #ffc107;
}

.toast.info {
  border-left-color: #17a2b8;
}

/* Toast Icon */
.toast-icon {
  font-size: 24px;
  margin-right: 15px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.toast.success .toast-icon {
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

.toast.error .toast-icon {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.toast.warning .toast-icon {
  color: #ffc107;
  background: rgba(255, 193, 7, 0.1);
}

.toast.info .toast-icon {
  color: #17a2b8;
  background: rgba(23, 162, 184, 0.1);
}

/* Toast Content */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* Close Button */
.toast-close {
  background: transparent;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  width: 100%;
  transform-origin: left;
}

.toast.success .toast-progress {
  background: #28a745;
}

.toast.error .toast-progress {
  background: #dc3545;
}

.toast.warning .toast-progress {
  background: #ffc107;
}

.toast.info .toast-progress {
  background: #17a2b8;
}

/* Animation for progress bar */
@keyframes progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.toast-progress.animate {
  animation: progress linear;
}

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

  .toast {
    min-width: auto;
    max-width: 100%;
  }

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

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

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

/* RTL Support */
[dir="rtl"] .toast-container {
  left: 20px;
  right: auto;
}

[dir="rtl"] .toast {
  transform: translateX(-400px);
}

[dir="rtl"] .toast.show {
  transform: translateX(0);
}

[dir="rtl"] .toast-icon {
  margin-right: 0;
  margin-left: 15px;
}

/* Loading State */
.toast.loading .toast-icon i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
