/**
 * Shared Toast Styles - Professional & High Performance
 */
:root {
  /* Fallbacks for Public Site */
  --toast-bg-default: rgba(255, 255, 255, 0.95);
  --toast-text-default: #1d1d1b;
  --toast-shadow-default: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.toast-container-global {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.custom-toast {
  /* Theme Aware Colors */
  /* Uses --bg-glass from variables.css (Admin) or fallback */
  background: var(--bg-elevated, var(--toast-bg-default));

  /* Uses --text-primary from variables.css (Admin) or fallback */
  color: var(--text-primary, var(--toast-text-default));

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  padding: 12px 18px;
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg, var(--toast-shadow-default));

  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;

  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.05));
  border-left: 6px solid var(--primary-color, #2fb5d2);

  transition: all 0.3s ease;
}

.toast-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  font-family: var(--font-sans, var(--secondary-font-family));
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted, #7a7a7a);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: opacity 0.2s ease;
}

.toast-close:hover {
  color: var(--text-primary, #000);
  opacity: 0.8;
}

/* Specific Types */
.custom-toast-success {
  border-left-color: var(--success, var(--success-color, #28a745));
}
.custom-toast-success .toast-icon {
  color: var(--success, var(--success-color, #28a745));
}

.custom-toast-error {
  border-left-color: var(--danger, var(--danger-color, #dc3545));
}
.custom-toast-error .toast-icon {
  color: var(--danger, var(--danger-color, #dc3545));
}

.custom-toast-warning {
  border-left-color: var(--warning, var(--warning-color, #ffc107));
}
.custom-toast-warning .toast-icon {
  color: var(--warning, var(--warning-color, #ffc107));
}

.custom-toast-info {
  border-left-color: var(--info, var(--primary-color, #2fb5d2));
}
.custom-toast-info .toast-icon {
  color: var(--info, var(--primary-color, #2fb5d2));
}

@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.custom-toast.hiding {
  animation: toastSlideOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 576px) {
  .toast-container-global {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
  }
  .custom-toast {
    min-width: 0;
    width: 100%;
  }
}
