/* ========== Skeleton Loading ========== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: skeleton-shimmer 1.5s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skeleton-message {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.skeleton-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.skeleton-role {
  width: 60px;
  height: 12px;
}

.skeleton-time {
  width: 40px;
  height: 12px;
}

.skeleton-content {
  width: 100%;
  height: 40px;
}

.skeleton-content-short {
  width: 60%;
  height: 16px;
  margin-top: 8px;
}

/* Loading spinner for buttons */
.button-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.button-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Init skeleton overlay */
.skeleton-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

.init-loading-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 16px;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
