/* ============================================================
   CareWheel Hub — chargement onglets (squelettes + overlay)
   ============================================================ */

.tab-panel-body {
  position: relative;
}

.tab-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0 1.5rem;
  animation: tab-loading-in 0.28s ease;
}

.tab-loading--overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  padding: 2rem 1rem;
  border-radius: var(--radius);
  background: rgba(5, 10, 16, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  justify-content: center;
}

.tab-loading-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.tab-loading-wheel {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.tab-loading-wheel .carewheel-logo,
.tab-loading-wheel svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tab-loading-label {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.tab-loading-skeletons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tab-skeleton-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0.75rem;
}

.tab-skeleton-card--device {
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 0.85rem;
}

.tab-skeleton-card--settings {
  gap: 0.65rem;
}

.tab-skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tab-skeleton-thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.tab-skeleton-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tab-skeleton-line {
  height: 0.72rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(120, 190, 220, 0.08) 0%,
    rgba(120, 190, 220, 0.18) 45%,
    rgba(120, 190, 220, 0.08) 90%
  );
  background-size: 200% 100%;
  animation: tab-skeleton-shimmer 1.35s ease-in-out infinite;
}

.tab-skeleton-line--title {
  width: 42%;
  height: 0.85rem;
}

.tab-skeleton-line--subtitle {
  width: 58%;
}

.tab-skeleton-line--meta {
  width: 32%;
  height: 0.62rem;
}

.tab-skeleton-line--short {
  width: 28%;
}

.tab-skeleton-line--full {
  width: 100%;
}

.tab-skeleton-line--medium {
  width: 72%;
}

.tab-skeleton-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.tab-skeleton-metric {
  height: 3.25rem;
  border-radius: var(--radius-sm);
}

.tab-skeleton-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-xs);
}

.tab-skeleton-pills {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.tab-skeleton-pill {
  width: 3.25rem;
  height: 1.35rem;
  border-radius: 999px;
}

.tab-skeleton-dev-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.tab-skeleton-dev-card {
  min-height: 7.5rem;
}

.tab-skeleton-thumb,
.tab-skeleton-metric,
.tab-skeleton-icon,
.tab-skeleton-pill {
  background: linear-gradient(
    90deg,
    rgba(120, 190, 220, 0.06) 0%,
    rgba(120, 190, 220, 0.16) 45%,
    rgba(120, 190, 220, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: tab-skeleton-shimmer 1.35s ease-in-out infinite;
}

.tab-skeleton-card:nth-child(2) .tab-skeleton-line,
.tab-skeleton-card:nth-child(2) .tab-skeleton-thumb,
.tab-skeleton-card:nth-child(2) .tab-skeleton-metric {
  animation-delay: 0.12s;
}

.tab-skeleton-card:nth-child(3) .tab-skeleton-line,
.tab-skeleton-card:nth-child(3) .tab-skeleton-thumb,
.tab-skeleton-card:nth-child(3) .tab-skeleton-metric {
  animation-delay: 0.24s;
}

.tab-content-dimmed {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.tab-section.active .enclosures-stack,
.tab-section.active .animals-stack,
.tab-section.active .devices-root {
  animation: tab-content-in 0.32s ease;
}

@keyframes tab-skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes tab-loading-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes tab-content-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Indicateur de chargement sur l'onglet actif */
.nav-tab.is-loading {
  position: relative;
}

.nav-tab.is-loading::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse-dot 1s ease infinite;
}

@media (min-width: 768px) {
  .nav-tab.is-loading::after {
    bottom: 4px;
  }
}
