/**
 * Y Combinator QW-5: Konsistente Loading States
 * Einheitliches Skeleton-Loading mit Shimmer-Effekt
 *
 * @version 1.0.0
 * @date 2026-01-04
 *
 * USAGE:
 * - Add .skeleton class to any element
 * - Or use .skeleton-card, .skeleton-line, etc.
 */

/* ================================================
   BASE SKELETON SHIMMER
   ================================================ */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-card, #1e1e1e);
  border-radius: 8px;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 40%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.05) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

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

/* ================================================
   SKELETON CARD (Feed Item)
   ================================================ */

.skeleton-card {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border, #2d3748);
}

.skeleton-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.skeleton-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card__meta {
  flex: 1;
}

.skeleton-card__title {
  height: 14px;
  width: 60%;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-card__subtitle {
  height: 10px;
  width: 40%;
  border-radius: 4px;
}

.skeleton-card__content {
  margin-bottom: 12px;
}

.skeleton-card__line {
  height: 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-card__line--full {
  width: 100%;
}

.skeleton-card__line--75 {
  width: 75%;
}

.skeleton-card__line--50 {
  width: 50%;
}

.skeleton-card__actions {
  display: flex;
  gap: 8px;
}

.skeleton-card__button {
  height: 32px;
  width: 80px;
  border-radius: 8px;
}

/* ================================================
   SKELETON LINE (Text)
   ================================================ */

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line--sm {
  height: 10px;
}

.skeleton-line--lg {
  height: 18px;
}

/* ================================================
   SKELETON CIRCLE (Avatar/Icon)
   ================================================ */

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-circle--sm {
  width: 24px;
  height: 24px;
}

.skeleton-circle--md {
  width: 40px;
  height: 40px;
}

.skeleton-circle--lg {
  width: 64px;
  height: 64px;
}

/* ================================================
   SKELETON BOX (Generic)
   ================================================ */

.skeleton-box {
  border-radius: 8px;
}

.skeleton-box--sm {
  height: 60px;
}

.skeleton-box--md {
  height: 120px;
}

.skeleton-box--lg {
  height: 200px;
}

/* ================================================
   SMART STACK SKELETON
   ================================================ */

.ss-skeleton {
  padding: 16px;
}

.ss-skeleton__section {
  margin-bottom: 20px;
}

.ss-skeleton__section-header {
  height: 16px;
  width: 120px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.ss-skeleton__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg-card, #1e1e1e);
  border: 1px solid var(--color-border, #2d3748);
  border-radius: 12px;
  margin-bottom: 8px;
}

.ss-skeleton__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.ss-skeleton__content {
  flex: 1;
}

.ss-skeleton__title {
  height: 14px;
  width: 70%;
  border-radius: 4px;
  margin-bottom: 8px;
}

.ss-skeleton__meta {
  height: 10px;
  width: 40%;
  border-radius: 4px;
}

/* ================================================
   LOADING TEXT ANIMATION
   ================================================ */

.loading-dots::after {
  content: '';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ================================================
   PULSE LOADING (Alternative)
   ================================================ */

.skeleton--pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton--pulse::after {
  display: none;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

/* ================================================
   LIGHT MODE SUPPORT
   ================================================ */

[data-template="light-modern"] .skeleton {
  background: #e2e8f0;
}

[data-template="light-modern"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.5) 60%,
    transparent 100%
  );
}

[data-template="light-modern"] .ss-skeleton__item {
  background: #f7fafc;
  border-color: #e2e8f0;
}

/* ================================================
   PROCESSING STATE (Analyzing...)
   ================================================ */

.processing-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary, #667eea);
  font-size: 14px;
}

.processing-text__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border, #2d3748);
  border-top-color: var(--color-primary, #667eea);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.processing-text__label {
  animation: processing-fade 1.5s ease-in-out infinite;
}

@keyframes processing-fade {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
