/* css/components.css — Toast, Modal, shared UI */

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(12,18,35,0.96);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 26px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  backdrop-filter: blur(20px);
  opacity: 0;
  transition: all 0.38s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success { border-color: rgba(16,185,129,0.45); }
.toast-error   { border-color: rgba(239,68,68,0.45); }
.toast-info    { border-color: rgba(59,130,246,0.35); }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(6px);
  padding: 24px;
  animation: modal-fade-in 0.25s ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  animation: modal-slide-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modal-slide-in {
  from { transform: scale(0.92) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0);        opacity: 1; }
}

.modal h3 {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.modal p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
  margin-bottom: 28px;
}

.modal p strong { color: var(--text); }

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue);
  border: none;
  color: #fff;
  transition: opacity 0.2s, transform 0.15s;
}

.modal-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.modal-btn:active { transform: translateY(0); }

.modal-btn-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.modal-btn-secondary:hover { background: rgba(255,255,255,0.09); opacity: 1; }

/* ── Button spinner (used in loading state) ── */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* spin is defined in background.css but we redefine here to be safe */
@keyframes spin { to { transform: rotate(360deg); } }