/**
 * DOLPHIN TOURNAMENTS — dt-toast.css
 * Custom toast notification system
 * Top-right positioned, icon + title + message + progress bar
 */

#dt-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 320px;
  max-width: calc(100vw - 32px);
}

.dt-toast-item {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 13px 14px 13px 14px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  /* Entry animation */
  animation: dt-toast-in 0.22s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
  transform-origin: top right;
}

.dt-toast-item.dt-toast-out {
  animation: dt-toast-out 0.18s ease forwards;
}

@keyframes dt-toast-in {
  from { opacity: 0; transform: translateX(28px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes dt-toast-out {
  from { opacity: 1; transform: translateX(0) scale(1);   max-height: 120px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(28px) scale(0.95); max-height: 0;   margin-bottom: -10px; }
}

/* Left accent bar */
.dt-toast-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.dt-toast-success::before { background: var(--green); }
.dt-toast-error::before   { background: var(--red); }
.dt-toast-warning::before { background: var(--yellow); }
.dt-toast-info::before    { background: var(--accent); }

/* Icon */
.dt-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.dt-toast-success .dt-toast-icon { background: var(--green-dim);   color: var(--green); }
.dt-toast-error   .dt-toast-icon { background: var(--red-dim);     color: var(--red); }
.dt-toast-warning .dt-toast-icon { background: var(--yellow-dim);  color: var(--yellow); }
.dt-toast-info    .dt-toast-icon { background: var(--accent-dim);  color: var(--accent); }

/* Body */
.dt-toast-body {
  flex: 1;
  min-width: 0;
}
.dt-toast-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}
.dt-toast-msg {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
}

/* Close button */
.dt-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dt-toast-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Progress bar */
.dt-toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: width linear;
}
.dt-toast-success .dt-toast-progress { background: var(--green); }
.dt-toast-error   .dt-toast-progress { background: var(--red); }
.dt-toast-warning .dt-toast-progress { background: var(--yellow); }
.dt-toast-info    .dt-toast-progress { background: var(--accent); }

/* Light theme adjustments */
html[data-theme="light"] .dt-toast-item {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0,0,0,0.04);
}
