/* ═══════════════════════════════════════════════════════════
   CVGénio — Components CSS (Toasts, Modals, API Dialog)
   ═══════════════════════════════════════════════════════════ */

/* ═══════ TOAST NOTIFICATIONS ═══════ */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 20000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px; width: 100%;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 8px;
  background: var(--ink-mid); border: 1px solid var(--border-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  font-size: 13px; color: var(--text);
  transform: translateX(120%); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
}
.toast--visible { transform: translateX(0); opacity: 1; }
.toast--exiting { transform: translateX(120%); opacity: 0; }
.toast__icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.toast__message { flex: 1; line-height: 1.4; }
.toast__close {
  background: none; border: none; color: var(--text-hint); cursor: pointer;
  font-size: 18px; padding: 0 4px; transition: color 0.15s; flex-shrink: 0;
}
.toast__close:hover { color: var(--text); }

.toast--success { border-left: 3px solid var(--success); }
.toast--success .toast__icon { color: var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info { border-left: 3px solid var(--info); }
.toast--info .toast__icon { color: var(--info); }

/* ═══════ MODAL ═══════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 15000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.modal-overlay--visible { opacity: 1; }
.modal {
  background: var(--ink-mid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  max-width: 420px; width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  transform: scale(0.95); transition: transform 0.2s ease;
}
.modal-overlay--visible .modal { transform: scale(1); }
.modal__title { font-family: var(--font-serif); font-size: 20px; margin-bottom: 10px; color: var(--text); }
.modal__message { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ═══════ API KEY DIALOG ═══════ */
.api-key-dialog {
  position: fixed; inset: 0; z-index: 15000;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.api-key-dialog .dialog-content {
  background: var(--ink-mid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  max-width: 500px; width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease-out 0.1s both;
}
.api-key-dialog h3 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.api-key-dialog p { margin: 0 0 1rem; color: var(--text-muted); line-height: 1.5; }
.api-key-dialog ol { margin: 0 0 1.5rem; padding-left: 1.5rem; color: var(--text); }
.api-key-dialog li { margin-bottom: 0.5rem; line-height: 1.4; }
.api-key-dialog a { color: var(--gold); text-decoration: none; font-weight: 500; }
.api-key-dialog a:hover { text-decoration: underline; }
.api-key-dialog .input-group { display: flex; gap: 0.75rem; margin: 1.5rem 0; }
.api-key-dialog input {
  flex: 1; padding: 0.75rem 1rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-input); color: var(--text);
  font-family: var(--font-mono); font-size: 0.9rem;
}
.api-key-dialog input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ═══════ SPINNER ═══════ */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border-md); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════ EMPTY STATE ═══════ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state__icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state__text { font-size: 14px; line-height: 1.6; }
