/*
 * Skeleton da pagina de Contatos do Solarz Chat — mesmo padrao visual usado
 * em Acoes em Massa / SzBotsCard. Substitui o Spinner nativo do Chatwoot
 * por cards placeholder com shimmer.
 *
 * Acompanha sz-contacts-skeleton.js, que troca o DOM em runtime.
 * Deploy: /opt/solarz-hub/app/static/css/sz-contacts-skeleton.css
 */

/* Reflete CardLayout real: max-w-[60rem] mx-auto + flex-col gap-4 */
.sz-contacts-skeleton-wrap {
  padding: 0 24px 24px 24px;
  display: block !important;
}
.sz-contacts-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 60rem;
  margin: 0 auto;
}

/* Reflete CardLayout: rounded-xl, outline 1px outline-n-container, py-5 px-6 */
.sz-contact-skeleton-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  background: #FFFFFF;
  min-height: 88px;
}
html.dark .sz-contact-skeleton-card,
body.dark .sz-contact-skeleton-card {
  background: #1F2125;
  border-color: #3A3D42;
}

.sz-cs-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* Avatar real: size=48 rounded-full */
.sz-cs-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sz-cs-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
/* Linha 1: nome em text-base font-medium (16px) */
.sz-cs-name  { width: 38%; min-width: 180px; height: 16px; border-radius: 4px; }
/* Linha 2: phone | Ver detalhes — text-sm (14px) */
.sz-cs-phone { width: 55%; min-width: 240px; height: 12px; border-radius: 4px; }

/* Botão chevron à direita: Button size=xs (~32px) */
.sz-cs-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Header skeleton: cobre busca + icones + botao "Enviar Mensagem". */
.sz-csh-hidden { visibility: hidden !important; pointer-events: none; }
.sz-contacts-skeleton-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sz-csh-search { width: 220px; height: 38px; border-radius: 10px; }
.sz-csh-icons-group { display: flex; align-items: center; gap: 8px; }
.sz-csh-icon   { width: 32px; height: 32px; border-radius: 8px; }
.sz-csh-divider {
  width: 1px;
  height: 16px;
  background: #E5E7EB;
  flex-shrink: 0;
}
html.dark .sz-csh-divider,
body.dark .sz-csh-divider { background: #3A3D42; }
.sz-csh-btn    { width: 155px; height: 38px; border-radius: 10px; }

/* Footer skeleton: "Exibindo X de Y contatos" (esquerda) + paginacao (direita).
   Injetado como ultimo filho do container quando o Vue ainda nao renderizou o
   <footer> real (v-if="showPaginationFooter"). */
.sz-contacts-skeleton-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  max-width: 60rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.sz-csf-left { width: 200px; height: 14px; border-radius: 4px; }
.sz-csf-right { display: flex; align-items: center; gap: 8px; }
.sz-csf-icon { width: 28px; height: 28px; border-radius: 6px; }
.sz-csf-page { width: 28px; height: 28px; border-radius: 6px; }
.sz-csf-pages-text { width: 80px; height: 14px; border-radius: 4px; }
/* Esconde o <footer> real do Chatwoot durante o periodo de skeleton.
   display:none (e nao visibility) pra nao deixar espaco vazio embaixo do
   nosso footer skeleton injetado. */
.sz-csf-hidden { display: none !important; }

/* Overlay sobre a lista real, usado quando o Vue carrega antes do tempo
   minimo. Cobre o <main> com cards skeleton e some com fade. */
.sz-contacts-skeleton-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #FFFFFF;
  padding: 16px 24px 24px 24px;
  opacity: 1;
  transition: opacity 0.25s ease-out;
}
html.dark .sz-contacts-skeleton-overlay,
body.dark .sz-contacts-skeleton-overlay {
  background: #151718;
}
.sz-contacts-skeleton-overlay.sz-fading {
  opacity: 0;
  pointer-events: none;
}

/* Shimmer */
.sz-skel-bar {
  background: linear-gradient(90deg,
    #EDEFF2 0%, #F6F7F9 50%, #EDEFF2 100%);
  background-size: 200% 100%;
  animation: sz-contacts-shimmer 1.4s linear infinite;
}
html.dark .sz-skel-bar,
body.dark .sz-skel-bar {
  background: linear-gradient(90deg,
    #262A30 0%, #2F343C 50%, #262A30 100%);
  background-size: 200% 100%;
}
@keyframes sz-contacts-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
