/* notes.css */

/* Grupos */
.groups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.group-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.1s ease;
}

.group-btn span.group-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-btn.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.group-delete {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.8em;
  opacity: 0.7;
  padding: 0 0 0 2px;
}

.group-delete:hover {
  opacity: 1;
}

.add-group-btn {
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.add-group-btn:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

/* Busca */
.section-header.with-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-wrapper {
  flex: 1;
}

#searchInput {
  width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.01);
  font-size: 0.88rem;
  color: var(--text);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

/* Lista de notas */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Estado vazio */
.empty-state {
  text-align: center;
  padding: 30px 14px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Cartão de nota */
.note-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.15s ease, border-color 0.2s;
}

body.dark .note-card {
  background: rgba(15, 23, 42, 0.7);
}

.note-card:hover {
  background: rgba(148, 163, 184, 0.05);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  border-color: rgba(148, 163, 184, 0.6);
}

.note-card-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.note-card-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.note-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.note-action-btn {
  border-radius: 999px;
  border: none;
  background: transparent;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.note-action-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--primary);
}

/* Editor */
.note-title-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  margin-bottom: 8px;
  background: rgba(15, 23, 42, 0.01);
  color: var(--text);
}

.note-title-input::placeholder {
  color: var(--text-muted);
}

/* Barra de ferramentas */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.toolbar button {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toolbar button:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.toolbar select {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 4px 6px;
  font-size: 0.8rem;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

/* Área rich text */
.note-content-input {
  min-height: 140px;
  max-height: 260px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.01);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.note-content-input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.2);
}

/* Placeholder em contenteditable */
.note-content-input[placeholder]:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
}