/**
 * Toast Messages Styles
 * Global toast notification system for YL theme
 */

.yl-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
}

.yl-toast {
  position: relative;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 12px;
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.yl-toast.hide {
  transform: translateX(100%);
  opacity: 0;
}

.yl-toast-content {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
}

.yl-toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.yl-toast-icon i {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

.yl-toast-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yl-toast-message .toast-title {
  color: #0f0d13;
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}

.yl-toast-message .toast-description {
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0%;
  color: #5c5a60;
  margin: 0;
  font-weight: 400;
}

.yl-toast-close {
  background: none;
  border: none;
  color: #374151;
  cursor: pointer;
  padding: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

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

.yl-toast-close i {
  font-size: 14px;
}

.yl-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(0, 0, 0, 0.05);
  width: 100%;
}

.yl-toast-progress::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: currentColor;
  animation: toast-progress 5s linear forwards;
}

/* Toast Types */
.yl-toast-success {
  background: #f0fdf4;
}

.yl-toast-success .yl-toast-icon {
  background: #059669;
}

.yl-toast-success .yl-toast-progress::before {
  background: #059669;
}

.yl-toast-error {
  background: #fbebeb;
}

.yl-toast-error .yl-toast-icon {
  background: #dc2626;
}

.yl-toast-error .yl-toast-progress::before {
  background: #dc2626;
}

.yl-toast-warning {
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.1);
}

.yl-toast-warning .yl-toast-icon {
  background: #d97706;
}

.yl-toast-warning .yl-toast-progress::before {
  background: #d97706;
}

.yl-toast-info {
  background: #eff6ff;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.yl-toast-info .yl-toast-icon {
  background: #2563eb;
}

.yl-toast-info .yl-toast-progress::before {
  background: #2563eb;
}

/* Progress Animation */
@keyframes toast-progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

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

  .yl-toast {
    min-width: auto;
    max-width: none;
  }

  .yl-toast-content {
    padding: 14px 16px;
  }

  .yl-toast-message .toast-title {
    font-size: 14px;
  }

  .yl-toast-message .toast-description {
    font-size: 12px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .yl-toast {
    background: #1f2937;
  }

  .yl-toast-message .toast-title {
    color: #0f0d13;
  }

  .yl-toast-message .toast-description {
    color: #5c5a60;
  }

  .yl-toast-close {
    color: #282729;
  }

  .yl-toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
  }

  .yl-toast-success {
    background: #e7fdf9;
  }

  .yl-toast-error {
    background: #fbebeb;
  }

  .yl-toast-warning {
    background: #451a03;
    border: 1px solid rgba(245, 158, 11, 0.2);
  }

  .yl-toast-info {
    background: #1e3a8a;
    border: 1px solid rgba(59, 130, 246, 0.2);
  }
}
