.tags-view {
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  background-color: var(--background-primary);
}

.tags-view-header {
  margin-bottom: 32px;
}

.tags-view-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tags-view-content {
  max-width: 900px;
}

/* Text utilities */
.text-muted {
  color: var(--text-secondary);
}

.text-small {
  font-size: 0.85rem;
}

/* Section */
.tags-section {
  margin-bottom: 40px;
  padding-top: 8px;
}

.tags-section-header {
  margin-bottom: 16px;
}

.tags-section-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tags-section-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tags-section-content {
  padding: 16px;
  background-color: var(--background-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* Loading and Empty States */
.tags-loading,
.tags-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

.tags-empty button {
  margin-top: 16px;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tag-cloud-item:hover {
  border-color: var(--accent-color);
  background: var(--background-hover);
}

.tag-cloud-item.selected {
  border-color: var(--accent-color);
  background: var(--accent-color-transparent);
  box-shadow: 0 0 0 2px var(--accent-color-transparent);
}

.tag-cloud-item.has-color {
  border: none;
  padding: 7px 13px;
  border-radius: 16px;
}

.tag-cloud-item.has-color:hover {
  opacity: 0.9;
}

.tag-cloud-item.has-color.selected {
  box-shadow: 0 0 0 3px var(--accent-color);
}

.tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.tag-cloud-item:not(.has-color) .tag-count {
  background: var(--background-tertiary);
}

/* Selection Info */
.tag-selection-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--accent-color-transparent);
  border-radius: 6px;
  font-size: 0.9rem;
}

.tag-selection-info button {
  font-size: 0.85rem;
  padding: 4px 12px;
}

/* Forms */
.tag-create-form,
.tag-edit-form,
.merge-form {
  margin-bottom: 16px;
}

.tag-create-form h4,
.tag-edit-form h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.tag-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-form-row input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.tag-form-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
}

.tag-form-row select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.tag-form-row select:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* Color picker group */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.color-picker-group input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  background: var(--background-primary);
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
  border-radius: 2px;
  border: none;
}

.clear-color {
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  min-width: auto !important;
  background: var(--background-tertiary) !important;
  border: none !important;
}

.clear-color:hover {
  background: var(--background-hover) !important;
}

/* Color presets */
.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.color-preset {
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.color-preset:hover {
  transform: scale(1.15);
  border-color: var(--text-secondary);
}

/* Tag preview */
.tag-preview {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Buttons */
.tags-view button {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tags-view button:hover {
  background: var(--background-hover);
  border-color: var(--text-secondary);
}

.tags-view button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tags-view button.primary {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.tags-view button.primary:hover {
  opacity: 0.9;
}

.tags-view button.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.tags-view button.danger:hover {
  opacity: 0.9;
}

/* Confirm Dialog */
.confirm-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-dialog {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.confirm-dialog h3 {
  margin: 0 0 12px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.confirm-dialog p {
  margin: 0 0 20px 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
