/* Watched Folders home-page card grid.
 *
 * Mirrors the files-page card vocabulary (see filesPage/FilesPage.css) but
 * with its own `.wf-*` namespace so the two surfaces can evolve
 * independently. Values are intentionally copied rather than shared. */

@keyframes wf-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
}

.wf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.16s cubic-bezier(0.32, 0.72, 0.32, 1),
    border-color 0.14s ease,
    box-shadow 0.18s ease;
}

.wf-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(
    in srgb,
    var(--accent-interactive, #6366f1) 35%,
    var(--border-subtle)
  );
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 8px 24px -8px rgba(0, 0, 0, 0.18);
}

.wf-card:focus-visible {
  outline: 2px solid var(--accent-interactive, #6366f1);
  outline-offset: 2px;
}

.wf-card.is-drop-target {
  background: color-mix(
    in srgb,
    var(--accent-interactive, #6366f1) 10%,
    var(--bg-surface)
  );
  box-shadow: 0 0 0 2px var(--accent-interactive, #6366f1);
  border-color: var(--accent-interactive, #6366f1);
}

/* Dragging a file the folder already contains — signal it's a no-op, not an add. */
.wf-card.is-already-member {
  background: color-mix(in srgb, #f59e0b 8%, var(--bg-surface));
  box-shadow: 0 0 0 2px #f59e0b;
  border-color: #f59e0b;
}

.wf-card-drag-message {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
  backdrop-filter: blur(1px);
  border-radius: inherit;
  /* Let drag/drop events pass through to the card underneath. */
  pointer-events: none;
}

.wf-card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--text-muted) 5%, var(--bg-surface)),
    var(--bg-surface)
  );
  aspect-ratio: 1.6 / 1;
  padding: 0.75rem;
}

.wf-card-body {
  padding: 0.65rem 0.85rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.wf-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.wf-card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wf-card-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.wf-card-status-dot.is-pulsing {
  animation: wf-pulse 1.4s ease-in-out infinite;
}

.wf-card-actions {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 4;
  display: flex;
  gap: 0.15rem;
}

.wf-card:hover .wf-card-actions,
.wf-card:focus-within .wf-card-actions {
  opacity: 1;
}

/* "New folder" tile - a dashed call-to-action that sits in the grid
   alongside the real folder cards. */
.wf-new-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-subtle);
  border-radius: 0.85rem;
  padding: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  min-height: 9rem;
  transition:
    border-color 0.14s ease,
    color 0.14s ease,
    background-color 0.14s ease;
}

.wf-new-tile:hover {
  border-color: var(--accent-interactive, #6366f1);
  color: var(--accent-interactive, #6366f1);
  background: color-mix(
    in srgb,
    var(--accent-interactive, #6366f1) 6%,
    var(--bg-surface)
  );
}

.wf-new-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: color-mix(
    in srgb,
    var(--accent-interactive, #6366f1) 12%,
    transparent
  );
  color: var(--accent-interactive, #6366f1);
}

.wf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.wf-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: color-mix(
    in srgb,
    var(--accent-interactive, #6366f1) 12%,
    transparent
  );
  color: var(--accent-interactive, #6366f1);
  margin-bottom: 0.25rem;
}

.wf-empty-title {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wf-empty-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 30rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .wf-card,
  .wf-card:hover {
    transform: none;
    transition: none;
  }
}
