/* ===== LOADING SYSTEM — Delegated to global-system.css ===== */
/* The branded Zaventra loader and skeletons are defined in global-system.css */
/* This file remains for backward compatibility of '#content.transitioning' */

/* ═════ ZAVENTRA WORKSTATION — MINIMALIST GLOBAL LOADER ═════ */
.zmg-loader-wrap {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: auto;
}

.zmg-loader-wrap.hidden,
.zmg-loader-wrap.zmg-loader-done {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: none !important;
}

/* Ensure create button and header dropdowns never poke through active loader */
body:has(#loadingScreen:not(.zmg-loader-done):not(.hidden)) .create-dropdown-wrap,
body:has(#loadingScreen:not(.zmg-loader-done):not(.hidden)) #headerCreateBtn,
body:has(#loadingScreen:not(.zmg-loader-done):not(.hidden)) #headerCreateMenu {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.zmg-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  user-select: none;
}

.zmg-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 3.5px solid #ede9fe;
  border-top-color: #6366f1;
  animation: zmgSpin 0.75s linear infinite;
}

.zmg-loader-text {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
}

@keyframes zmgSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .zmg-spinner {
    animation-duration: 2.5s;
  }
}

/* ─── INLINE LOADER FOR SECTIONS, TABLES, DRAWERS & MODALS ─── */
.zmg-loader-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  width: 100%;
  gap: 12px;
  user-select: none;
}

.zmg-loader-inline .zmg-spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.zmg-loader-inline .zmg-loader-text {
  font-size: 13.5px;
  color: #64748b;
}

.zmg-loader-gif {
  display: none !important;
}

/* ===== HIDE DRAWDERS UNTIL OPENED (prevent load flash) ===== */
.artist-drawer-overlay, .artist-drawer { visibility: hidden; }
.artist-drawer-overlay.open, .artist-drawer.open { visibility: visible; }

#content {
  transition: opacity .2s ease;
}
#content.transitioning {
  opacity: 0;
}

/* ===== SESSION EXPIRED MODAL ===== */
.se-modal {
  position: fixed; inset: 0; z-index: var(--z-critical);
  display: flex; align-items: center; justify-content: center;
}
.se-modal.hidden { display: none; }
.se-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.se-card {
  position: relative; z-index: 1;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 16px; padding: 40px; text-align: center; max-width: 380px; width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,.12);
  animation: seSlideUp .3s ease;
}
.se-icon { font-size: 40px; margin-bottom: 12px; }
.se-card h3 { margin: 0 0 8px; font-size: 18px; color: #000; }
.se-card p { margin: 0 0 8px; color: #6b7280; font-size: 13px; line-height: 1.5; }
.se-note { display: block; margin-bottom: 20px; color: #2563eb; font-size: 12px; }
.se-signin-btn { width: 100%; }

@keyframes seSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== LOGOUT OVERLAY ===== */
.logout-overlay {
  position: fixed; inset: 0; z-index: var(--z-toast);
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,14,17,.72);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.logout-overlay.visible { opacity: 1; pointer-events: auto; }
.logout-card { text-align: center; }
.logout-spinner {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: logoutSpin .8s linear infinite;
}
.logout-card p {
  color: var(--text); font: 600 14px/1.4 'Manrope', Arial, sans-serif;
  letter-spacing: .04em; margin: 0;
  animation: logoutPulse 1.4s ease-in-out infinite;
}
@keyframes logoutSpin { to { transform: rotate(360deg); } }
@keyframes logoutPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
