/* ═══════════════════════════════════════════════════════════════════
   CricBun Toast / Notification Component
   ═══════════════════════════════════════════════════════════════════ */

.cb-toast-container {
  position: fixed;
  top: calc(var(--cb-header-h, 56px) + var(--cb-space-base));
  right: var(--cb-space-base);
  z-index: var(--cb-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--cb-space-sm);
  max-width: 400px;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 767px) {
  .cb-toast-container {
    left: var(--cb-space-base);
    right: var(--cb-space-base);
    max-width: none;
  }
}

.cb-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--cb-space-sm);
  padding: var(--cb-space-sm) var(--cb-space-base);
  background: var(--cb-bg);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-md);
  box-shadow: var(--cb-shadow-lg);
  pointer-events: auto;
  animation: cb-toast-in 300ms ease forwards;
  position: relative;
  overflow: hidden;
}

@keyframes cb-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cb-toast--exiting {
  animation: cb-toast-out 200ms ease forwards;
}

@keyframes cb-toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.cb-toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.cb-toast__body {
  flex: 1;
  min-width: 0;
}

.cb-toast__title {
  font-size: var(--cb-text-sm);
  font-weight: var(--cb-weight-semibold);
  margin: 0 0 var(--cb-space-2xs) 0;
}

.cb-toast__message {
  font-size: var(--cb-text-sm);
  color: var(--cb-text-secondary);
  margin: 0;
}

.cb-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--cb-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cb-radius-sm);
  font-size: var(--cb-text-lg);
}

.cb-toast__close:hover {
  background: var(--cb-bg-subtle);
  color: var(--cb-text);
}

/* ── Variants ── */
.cb-toast--success { border-left: 3px solid var(--cb-success); }
.cb-toast--error { border-left: 3px solid var(--cb-accent); }
.cb-toast--warning { border-left: 3px solid var(--cb-warning); }
.cb-toast--info { border-left: 3px solid var(--cb-primary); }

/* ── Progress bar ── */
.cb-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--cb-primary);
  animation: cb-toast-progress 4s linear forwards;
}

@keyframes cb-toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

.cb-toast--success .cb-toast__progress { background: var(--cb-success); }
.cb-toast--error .cb-toast__progress { background: var(--cb-accent); }
.cb-toast--warning .cb-toast__progress { background: var(--cb-warning); }
