/* ============================================
   STORY FORGE — Modals & Toasts
   ============================================ */

/* ---- Modal overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 16, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title { font-family: var(--font-serif); font-size: var(--text-xl); color: var(--text-primary); }

.modal-close {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--bg-glass-md); color: var(--text-primary); }

.modal-body   { padding: var(--space-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

/* ---- Toasts ---- */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.hiding { animation: toastSlideOut 0.25s ease forwards; }

.toast-icon      { width: 20px; height: 20px; flex-shrink: 0; }
.toast-success   { border-left: 3px solid var(--accent-teal); }
.toast-success .toast-icon { color: var(--accent-teal); }
.toast-error     { border-left: 3px solid var(--accent-rose); }
.toast-error .toast-icon   { color: var(--accent-rose); }
.toast-info      { border-left: 3px solid var(--accent-secondary); }
.toast-info .toast-icon    { color: var(--accent-secondary); }
.toast-warning   { border-left: 3px solid var(--accent-gold); }
.toast-warning .toast-icon { color: var(--accent-gold); }

.toast-message { font-size: var(--text-sm); color: var(--text-secondary); flex: 1; line-height: 1.4; }
.toast-title   { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 2px; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }
