/* Capture View */
#view-capture {
  gap: var(--space-3);
}

/* Capture Header */
.capture-header {
  margin-bottom: var(--space-1);
}

.capture-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  width: 100%;
}

.capture-header .page-title {
  font-size: 1.5rem;
  font-weight: var(--font-light);
  margin: 0;
}

.capture-sync-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 12px;
  font-size: 0.8125rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.filter-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

.capture-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 100%;
  overflow: hidden;
}

#thought-input {
  min-height: 200px;
  font-size: 1.125rem;
  line-height: 1.6;
  background-color: var(--bg-secondary);
  border: none;
  resize: none;
  max-width: 100%;
  box-sizing: border-box;
}

#thought-input::placeholder {
  color: var(--text-subtle);
}

#thought-input:focus {
  border: none;
}

/* Tag Row */
.tag-row {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.tag-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  font-size: 1.25rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.tag-btn:hover {
  background-color: var(--bg-tertiary);
  transform: scale(1.05);
}

.tag-btn.active {
  background-color: var(--text-primary);
  transform: scale(1.1);
}

#save-thought-btn {
  align-self: center;
  min-width: 140px;
}

/* Thoughts List */
.thoughts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.thought-item {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.thought-text {
  color: var(--text-primary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-1);
  white-space: pre-wrap;
}

.thought-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thought-tags {
  display: flex;
  gap: var(--space-1);
}

.thought-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-muted);
}

.thought-date {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.thought-meta-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Editable Items */
.thought-text {
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: var(--radius-sm);
}

.thought-text:hover {
  background-color: var(--bg-tertiary);
}

.thought-edit-input {
  width: 100%;
  min-height: 60px;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: var(--space-1);
  resize: vertical;
}

.item-delete-btn {
  font-size: 1.25rem;
  color: var(--text-subtle);
  padding: 0 4px;
  opacity: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.thought-item:hover .item-delete-btn {
  opacity: 1;
}

.item-delete-btn:hover {
  color: var(--accent-connection);
}

/* =============================================
   RESPONSIVE / MOBILE STYLES - CAPTURE VIEW
   ============================================= */

/* Touch device detection - always show delete buttons */
@media (hover: none) and (pointer: coarse) {
  .item-delete-btn {
    opacity: 0.6;
  }

  .thought-item .item-delete-btn {
    opacity: 0.6;
  }

  /* Larger touch target for delete */
  .item-delete-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Tablet breakpoint */
@media (max-width: 768px) {
  .capture-container {
    gap: var(--space-2);
  }

  #thought-input {
    min-height: 160px;
    font-size: 1rem;
  }

  .tag-btn {
    width: 44px;
    height: 44px;
    font-size: 1.125rem;
  }
}

/* Phone breakpoint */
@media (max-width: 480px) {
  #view-capture {
    gap: var(--space-2);
  }

  .capture-header-top {
    margin-bottom: var(--space-1);
  }

  .capture-header .page-title {
    font-size: 1.25rem;
  }

  .capture-sync-actions {
    gap: 4px;
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 36px;
  }

  .capture-container {
    gap: var(--space-2);
  }

  /* Reduced height for mobile */
  #thought-input {
    min-height: 120px;
    font-size: 16px; /* Prevents iOS zoom */
    line-height: 1.5;
    padding: var(--space-2);
  }

  /* Tag buttons */
  .tag-row {
    gap: var(--space-1);
  }

  .tag-btn {
    width: 44px;
    height: 44px;
    font-size: 1.125rem;
  }

  .tag-btn.active {
    transform: scale(1.05);
  }

  #save-thought-btn {
    min-width: 120px;
    min-height: 44px;
  }

  /* Thoughts list */
  .thoughts-list {
    gap: var(--space-1);
    margin-top: var(--space-1);
  }

  .thought-item {
    padding: var(--space-2);
  }

  .thought-text {
    font-size: 0.875rem;
    padding: var(--space-1);
    margin: calc(-1 * var(--space-1));
  }

  .thought-meta {
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  .thought-tags {
    flex-wrap: wrap;
  }

  .thought-tag {
    font-size: 0.6875rem;
    padding: 2px 6px;
  }

  .thought-date {
    font-size: 0.6875rem;
  }

  /* Delete button always visible */
  .thought-item .item-delete-btn {
    opacity: 0.7;
    min-width: 44px;
    min-height: 44px;
  }

  .thought-edit-input {
    font-size: 16px; /* Prevents iOS zoom */
    min-height: 80px;
  }
}

/* Small phone breakpoint */
@media (max-width: 320px) {
  #thought-input {
    min-height: 100px;
  }

  .tag-row {
    gap: 6px;
  }

  .tag-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .thought-text {
    font-size: 0.8125rem;
  }

  .thought-tag {
    font-size: 0.625rem;
  }
}
