.sidecar-viewer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0;
  width: 100%;
  min-height: 100%;
  animation: fadeIn 0.3s ease-in;

  @media (min-width: 768px) {
    padding: 0.5rem;
  }
}

.sidecar-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);

  @media (min-width: 640px) {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.header-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
  }

  .header-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

::ng-deep .sync-status-tag {
  font-size: 0.75rem;
  font-weight: 600;
}

.loading-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--text-color-secondary);

  i {
    font-size: 2rem;
    color: var(--primary-color);
  }

  span {
    font-size: 0.95rem;
  }
}

.sidecar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--surface-ground);
  border: 1px dashed var(--border-color);
  border-radius: 0.75rem;

  i {
    font-size: 3rem;
    color: var(--text-color-secondary);
    opacity: 0.5;
    margin-bottom: 1rem;
  }

  h4 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
  }

  p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    max-width: 400px;
    line-height: 1.5;
  }
}

.sidecar-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-color-secondary);

  i {
    font-size: 0.875rem;
    color: var(--primary-color);
  }
}

.json-viewer {
  background: var(--surface-ground);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.json-content {
  margin: 0;
  padding: 1rem;
  font-family: 'SF Mono', 'Consolas', 'Monaco', 'Menlo', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-color);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
  overflow-y: auto;

  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;

    &:hover {
      background: var(--text-color-secondary);
    }
  }
}

.cover-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-ground);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-color);

  i {
    color: var(--primary-color);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
