/**
 * atoms.css — Canonical shared CSS atoms.
 *
 * Single source of truth for the lowest-level design tokens and animation
 * keyframes. Loaded on every page BEFORE component-specific stylesheets so
 * these definitions are always available.
 *
 * Consolidates @keyframes that were previously duplicated across:
 *   main.css (×3), account-type-editor.css, bank-table.css, bank-upload.css
 *
 * DO NOT add component-specific rules here. This file is for atoms only.
 */

/* ============================================
   ANIMATION KEYFRAMES
   Canonical definitions — all other CSS files
   that used to redeclare these can simply remove
   their local copy.
   ============================================ */

/** Fade in with subtle upward motion — used for page-level transitions */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/** Simple opacity fade — used for modals and overlays */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/** Slide up entrance — used for modal-content panels */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/** Continuous spin — used for loading spinners */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================
   SKELETON / LOADING PULSE
   Canonical definition (skeleton.css may override
   with the same rule — that is intentional).
   ============================================ */

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.skeleton-pulse {
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* ============================================
   EMPTY STATE
   Canonical empty-state layout.
   Component CSS may add scoped overrides (e.g.
   border color, icon size) without redefining
   the base structure.
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-700);
  background: var(--color-grey-600);
  border: 1px dashed var(--color-grey-900);
  border-radius: var(--radius-lg, 12px);
  margin: 24px 0;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-message {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-700);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* ============================================
   MODAL OVERLAY
   The backdrop layer shared by every modal.
   Individual modal dialogs style .modal-content
   in their own CSS files so they can set their
   own max-width, padding, etc.
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-toast, 9000);
  animation: fadeIn 0.2s ease;
}

/* Unified close-button atom — works with both
   .btn-close-modal and .modal-close variants */
.btn-close-modal,
.modal-close,
.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-700);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 4px);
  transition: background 0.2s, color 0.2s;
}

.btn-close-modal:hover,
.modal-close:hover,
.modal-close-btn:hover {
  background: var(--color-grey-600);
  color: var(--color-text-900);
}

/* ============================================
   STAT CARD  (ui.js → statCard())
   ============================================ */

.stat-card {
  background: var(--color-neutral-white);
  border-radius: var(--radius-md, 8px);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-700);
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-900);
}

.stat-trend {
  font-size: 12px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: var(--radius-full, 9999px);
}

/* ============================================
   KPI CARD  (ui.js → kpiCard())
   ============================================ */

.kpi-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.8;
}
