/* ==========================================================================
   Toasts
   ========================================================================== */

/* Container */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  pointer-events: none;
  min-width: 420px;
  width: auto;
  max-width: 600px;
}

@media (max-width: 768px) {
  #toast-container {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
    min-width: 0;
  }
}

/* Toast base */
.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  overflow: hidden;
  border-left: 8px solid;
  min-width: 420px;
  width: auto;
  max-width: 600px;
}

@media (max-width: 768px) {
  .toast {
    min-width: 0;
    max-width: none;
  }
}

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

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-in;
}

/* Content layout */
.toast-content {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 30px;
  display: flex;
  align-items: center;
}

.toast-message {
  flex: 1;
  font-size: 16px;
  line-height: 1.5;
  color: #363636;
}

.toast-title {
  font-size: 18px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.toast-body {
  font-size: 16px;
  font-weight: 400;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #999;
  transition: color 0.2s;
  font-size: 16px;
}

.toast-close:hover {
  color: #363636;
}

/* Progress bar */
.toast-progress {
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.3;
  transition: width 0.1s linear;
}

/* Type variants */
.toast.is-success {
  border-left-color: #48c78e;
}

.toast.is-success .toast-icon {
  color: #48c78e;
}

.toast.is-danger {
  border-left-color: #f14668;
}

.toast.is-danger .toast-icon {
  color: #f14668;
}

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

.toast.is-warning .toast-icon {
  color: #ffb84d;
}

.toast.is-info {
  border-left-color: #3e8ed0;
}

.toast.is-info .toast-icon {
  color: #3e8ed0;
}

/* Actions */
.toast-actions {
  padding: 0 16px 12px 48px;
  display: flex;
  gap: 8px;
}

/* Dark mode */
[data-theme="dark"] .toast {
  background: #2b2b2b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .toast-message {
  color: #f5f5f5;
}

[data-theme="dark"] .toast-close {
  color: #999;
}

[data-theme="dark"] .toast-close:hover {
  color: #f5f5f5;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .toast {
    transform: translateY(-100%);
  }

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

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

/* Animation for stacking effect */
.toast:not(:last-child) {
  margin-bottom: 8px;
  transform-origin: bottom;
}

/* Ensure visibility over modals */
.modal.is-active ~ #toast-container {
  z-index: 10001;
}

/* ==========================================================================
   End Toasts
   ========================================================================== */
