/* =========================================================
   loading-utils.css  –  Standardized loading/waiting states
   ========================================================= */

/* ---- Keyframes ---- */
@keyframes lu-spin {
  to { transform: rotate(360deg); }
}

/* ---- Full-page overlay ---- */
#lu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
#lu-overlay.lu-visible {
  display: flex;
}
.lu-overlay-box {
  background: #ffffff;
  padding: 2rem 3rem;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  min-width: 200px;
}
.lu-overlay-spinner {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border: 4px solid rgba(49, 97, 144, 0.2);
  border-top-color: #316190;
  border-radius: 50%;
  animation: lu-spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}
.lu-overlay-msg {
  color: #2c3e50;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---- Inline button spinner ---- */
.lu-btn-spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: lu-spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 0.35em;
  flex-shrink: 0;
}

/* Dark-on-light variant (for light buttons) */
.lu-btn-spinner.lu-dark {
  border-color: rgba(44, 62, 80, 0.25);
  border-top-color: #2c3e50;
}

/* ---- Generic "loading" shimmer for containers ---- */
.lu-loading-container {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

/* ---- Toast notifications ---- */
#lu-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.lu-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #2c3e50;
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}
.lu-toast.lu-toast-in {
  opacity: 1;
  transform: translateX(0);
}
.lu-toast.lu-toast-out {
  opacity: 0;
  transform: translateX(20px);
}
.lu-toast-success { background: #2ecc71; }
.lu-toast-error   { background: #e74c3c; }
.lu-toast-warning { background: #f39c12; }
.lu-toast-info    { background: #316190; }
.lu-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.lu-toast-msg {
  flex: 1;
  word-wrap: break-word;
  line-height: 1.35;
}

/* ---- Inline cell flash on successful edit ---- */
@keyframes lu-cell-flash-anim {
  0%   { box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.0); }
  20%  { box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.85); }
  100% { box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.0); }
}
.lu-cell-flash {
  animation: lu-cell-flash-anim 0.7s ease-out;
}
