:root {
  --test: 1;
}

.pullToRefreshContainer {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-large);
  padding: calc(3rem + var(--spacing-small)) var(--spacing-medium) calc(6rem + var(--safe-area-inset-bottom));
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  height: 100%;
  -webkit-overflow-scrolling: touch; /* Для плавного скролла на iOS */
  transform: translateY(var(--pull-distance, 0px));
  transition: transform 0.3s ease-out;
}

.refreshIndicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(calc(-100% + var(--pull-distance, 0px)));
  transition: transform 0.3s ease-out;
  background-color: var(--color-surface);
  z-index: 10;
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.refreshSpinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-primary, #3498db);
  opacity: calc(var(--pull-distance, 0) / 80); /* Постепенно появляется */
  transform: rotate(calc(var(--pull-distance, 0) * 4.5deg)); /* Вращается при вытягивании */
}

.refreshing .refreshSpinner {
  opacity: 1;
  animation: spin 1s linear infinite;
}

.refreshIndicator span {
  margin-left: var(--spacing-small);
  color: var(--color-text);
}

.header {
  padding: var(--spacing-small) 0;
  text-align: center;
  margin-bottom: 0;
}

.title {
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--color-text);
  position: relative;
  display: inline-block;
}

.subtitle {
  margin-top: 0.25rem;
  color: var(--color-text);
  opacity: 0.6;
}

.placeholder {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  padding: var(--spacing-medium);
  text-align: center;
  color: var(--color-text);
  opacity: 0.6;
}

.imageGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--spacing-medium);
  margin-top: 0;
  animation: fadeUp 0.6s ease-out 0.2s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.imageItem {
  aspect-ratio: 1;
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: var(--color-surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Убираем подсветку при тапе на мобильных */
}

.image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.error {
  background-color: var(--color-error-bg, #ffebee);
  color: var(--color-error, #d32f2f);
  padding: var(--spacing-medium);
  border-radius: var(--border-radius);
  text-align: center;
}

/* Стили для отображения задач в очереди */
.pendingTasksSection {
  margin-bottom: var(--spacing-large);
}

.sectionTitle {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-small);
  color: var(--color-text);
}

.pendingTasksGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--spacing-medium);
  animation: fadeUp 0.6s ease-out 0.2s both;
}

.pendingTaskItem {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pendingTaskPlaceholder {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface-variant, #e0e0e0);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-primary, #3498db);
  animation: spin 1s ease-in-out infinite;
}

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

.pendingTaskInfo {
  padding: var(--spacing-small);
}

.pendingTaskStatus {
  font-weight: bold;
  margin: 0 0 5px;
  font-size: 0.9rem;
}

.pendingTaskTime {
  color: var(--color-text-secondary, #666);
  margin: 0;
  font-size: 0.8rem;
}
