/* ============================================================================
 * zg-enhance.css: ZOOGABOOG perceived-performance + UI polish  (ADDITIVE)
 * All new components namespaced .zge-* to avoid collision with .zg-* system.
 * ========================================================================== */
.btn {
  transition: color .12s ease, background-color .12s ease, border-color .12s ease,
              box-shadow .12s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
a { transition: color .12s ease, opacity .12s ease; }
.nav-link { transition: color .12s ease, background-color .12s ease; }
.table tbody tr { transition: background-color .12s ease; }
.card { transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.zge-lift { will-change: transform; }
.zge-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);
}
.zge-skeleton {
  display: block; position: relative; overflow: hidden;
  background-color: #e9edf2;
  background-image: linear-gradient(90deg,
      rgba(255,255,255,0) 0, rgba(255,255,255,.65) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%; background-repeat: no-repeat;
  border-radius: 8px; animation: zge-shimmer 1.4s ease-in-out infinite;
}
@keyframes zge-shimmer {
  0%   { background-position: -150% 0; }
  100% { background-position:  150% 0; }
}
.zge-skeleton-text { height: .8em; margin: .5em 0; border-radius: 4px; }
.zge-skeleton-text.zge-w-60 { width: 60%; }
.zge-skeleton-text.zge-w-80 { width: 80%; }
.zge-skeleton-title { height: 1.4em; width: 45%; margin: .25em 0 .75em; border-radius: 5px; }
.zge-skeleton-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.zge-skeleton-row > .zge-skeleton { flex: 1; }
.zge-skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px; }
.zge-skeleton-card {
  padding: 16px; border: 1px solid rgba(16,24,40,.06);
  border-radius: 12px; background: #fff;
}
.zge-skeleton-thumb {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; margin-bottom: 12px;
}
body.dark-mode .zge-skeleton {
  background-color: #2a2f37;
  background-image: linear-gradient(90deg,
      rgba(255,255,255,0) 0, rgba(255,255,255,.08) 50%, rgba(255,255,255,0) 100%);
}
body.dark-mode .zge-skeleton-card { background: #1f242b; border-color: rgba(255,255,255,.06); }
@media (prefers-reduced-motion: reduce) {
  .zge-skeleton { animation: none; background-image: none; }
}
.zge-empty-state { text-align: center; max-width: 460px; margin: 0 auto; padding: 40px 24px; }
.zge-empty-state__icon { font-size: 40px; line-height: 1; color: #98a2b3; margin-bottom: 14px; display: inline-flex; }
.zge-empty-state__title { font-size: 1.125rem; font-weight: 700; color: #1d2939; margin: 0 0 6px; }
.zge-empty-state__subtitle { font-size: .95rem; color: #667085; margin: 0 0 18px; line-height: 1.5; }
.zge-empty-state__action { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
body.dark-mode .zge-empty-state__title { color: #f2f4f7; }
body.dark-mode .zge-empty-state__subtitle { color: #98a2b3; }
.zge-toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 220px; max-width: 360px; padding: 12px 14px;
  background: #ffffff; color: #1d2939; border-left: 4px solid #01aade;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.08);
  font-size: .9rem; line-height: 1.4;
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease; pointer-events: auto;
}
.zge-toast.zge-toast--in { opacity: 1; transform: translateY(0); }
.zge-toast__msg { flex: 1; }
.zge-toast__close {
  border: 0; background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; color: #98a2b3; padding: 0 2px;
}
.zge-toast__close:hover { color: #475467; }
.zge-toast--success { border-left-color: #10b981; }
.zge-toast--info { border-left-color: #01aade; }
.zge-toast--warning { border-left-color: #d97706; }
.zge-toast--error { border-left-color: #dc2626; }
body.dark-mode .zge-toast { background: #1f242b; color: #f2f4f7; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
@media (prefers-reduced-motion: reduce) {
  .zge-toast { transition: none; opacity: 1; transform: none; }
}

/* ============================================================================
 * Admin data-table polish: sticky header + result-count badge  (ADDITIVE)
 * ========================================================================== */
.zge-sticky-table { max-height: 72vh; overflow-y: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.zge-sticky-table thead th {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 3;
  background: #f9fafb; box-shadow: inset 0 -1px 0 rgba(16, 24, 40, .12);
}
body.dark-mode .zge-sticky-table thead th { background: #1f242b; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .10); }
.zge-count {
  display: inline-flex; align-items: center; font-size: .75rem; font-weight: 600;
  line-height: 1; padding: 3px 9px; border-radius: 999px; color: #475467;
  background: #eef2f6; white-space: nowrap;
}
.zge-count:empty { display: none; }
.zge-count--filtered { color: #0b6e99; background: #e0f2fe; }
body.dark-mode .zge-count { color: #cbd5e1; background: #2a2f37; }
body.dark-mode .zge-count--filtered { color: #7dd3fc; background: #0c4a6e; }

/* ============================================================================
 * Double-submit guard: submit-button busy state  (ADDITIVE, applied by JS)
 * ========================================================================== */
.zge-submitting {
  pointer-events: none !important;
  opacity: .65;
  cursor: default;
}
.zge-btn-spinner {
  display: inline-block;
  width: 1em; height: 1em;
  margin-left: .45em;
  vertical-align: -.125em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: zge-btn-spin .65s linear infinite;
}
@keyframes zge-btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .zge-btn-spinner { animation: none; border-right-color: currentColor; opacity: .55; }
}

/* ============================================================================
 * Print stylesheet: clean invoices / orders / reports  (ADDITIVE)
 * body > footer targets ONLY the two classless chrome footers; content
 * footers (.zg-order-help / .zg-esign-footer) are nested in main, untouched.
 * ========================================================================== */
@media print {
  .zg-sidebar,
  .zg-header,
  .zg-rail, .zg-drawer,
  .client-sidebar, #clientSidebar,
  .client-sidebar-backdrop, #sidebarBackdrop,
  .navbar-logged-in,
  .client-footer, .client-footer-main, #clientFooter,
  .public-top-bar, .public-navbar-logged-out,
  .mobile-menu, #mobileMenu,
  body > footer,
  .cart-sidebar, #cartSidebar,
  .cart-backdrop, #cartBackdrop,
  .chatbot-container, .chatbot-toggle, .chatbot-window,
  #zb-cookie-banner,
  .exit-intent-overlay, #exitIntentPopup,
  .baby-rocket-section,
  #zg-toast-host, .zge-toast,
  .zg-a11y-skip-link,
  .zge-btn-spinner,
  .pagination,
  .btn:not(.zge-print-keep),
  button[type="submit"]:not(.zge-print-keep),
  input[type="submit"], input[type="button"], input[type="reset"] {
    display: none !important;
  }

  html body, html body.dark-mode {
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }
  .zg-main-content,
  body.zg-has-rail .zg-main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .client-main-content { margin: 0 !important; width: 100% !important; }

  *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
  .card, .zg-card,
  body.dark-mode .card, body.dark-mode .zg-card {
    background: #fff !important;
    color: #111 !important;
    border-color: #d0d5dd !important;
  }

  .zge-sticky-table { max-height: none !important; overflow: visible !important; }
  .zge-sticky-table thead th { position: static !important; box-shadow: none !important; }
  thead { display: table-header-group; }
  tr, .card, .zg-card, img { break-inside: avoid; page-break-inside: avoid; }

  a, a:visited { color: inherit !important; text-decoration: none !important; }
}
