/* ============================================================
   FLASH.CSS — Toast-style flash messages
   ============================================================ */

.flash-container {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: flashSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  position: relative;
  overflow: hidden;
}

.flash::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.flash-success::before { background: var(--success); }
.flash-error::before   { background: var(--danger);  }
.flash-warning::before { background: var(--warning); }
.flash-info::before    { background: var(--info);    }

.flash-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.flash-success .flash-icon { background: var(--success-dim); color: var(--success); }
.flash-error   .flash-icon { background: var(--danger-dim);  color: var(--danger);  }
.flash-warning .flash-icon { background: var(--warning-dim); color: var(--warning); }
.flash-info    .flash-icon { background: var(--info-dim);    color: var(--info);    }

.flash-body {
  flex: 1;
  min-width: 0;
}

.flash-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}

.flash-msg {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.flash-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  font-size: 0.75rem;
  padding: 0;
}

.flash-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Progress bar auto-dismiss indicator */
.flash-progress {
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-sm) 0;
  transform-origin: left;
  animation: flashProgress 5s linear forwards;
}

.flash-success .flash-progress { background: var(--success); }
.flash-error   .flash-progress { background: var(--danger);  }
.flash-warning .flash-progress { background: var(--warning); }
.flash-info    .flash-progress { background: var(--info);    }

.flash.dismissing {
  animation: flashSlideOut 0.3s ease forwards;
}

@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes flashSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 120px;
  }
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

@keyframes flashProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (max-width: 480px) {
  .flash-container {
    right: 12px;
    left: 12px;
    max-width: none;
  }
}