/* ── Notes Page CSS ── */

.notes-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.notes-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
  align-items: start;
}

.notes-grid.list-view {
  grid-template-columns: 1fr;
}

.note-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  height: 220px;
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
}

.note-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--note-accent-color, var(--accent-primary));
}

.note-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

.note-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-light), var(--shadow-md);
}

.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.note-card-title {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  word-break: break-word;
  padding-right: var(--space-4);
}

.note-card-pin-btn {
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
  padding: 2px;
}

.note-card-pin-btn.pinned {
  color: var(--accent-primary);
}

.note-card-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex-grow: 1;
  overflow: hidden;
  margin-bottom: var(--space-3);
  word-break: break-word;
  white-space: pre-wrap;
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-3);
}

.note-card-date {
  font-size: 10px;
  color: var(--text-muted);
}

.note-card-tags {
  display: flex;
  gap: var(--space-1);
  overflow: hidden;
  max-width: 60%;
}

.note-card-tag {
  font-size: 10px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* List View overrides */
.notes-grid.list-view .note-card {
  height: auto;
  flex-direction: row;
  align-items: center;
  padding: var(--space-3) var(--space-5);
}

.notes-grid.list-view .note-card::before {
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  height: 100%;
}

.notes-grid.list-view .note-card-header {
  margin-bottom: 0;
  width: 25%;
  flex-shrink: 0;
}

.notes-grid.list-view .note-card-body {
  margin-bottom: 0;
  flex-grow: 1;
  padding: 0 var(--space-4);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.notes-grid.list-view .note-card-footer {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
  width: 20%;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: var(--space-4);
}

/* Bulk Action Bar */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--accent-primary);
  color: #ffffff;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 14px var(--accent-light);
  animation: slideInDown var(--transition-base);
}

.bulk-action-bar .btn-ghost {
  color: #ffffff;
}

.bulk-action-bar .btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Note Editor Container */
.note-editor-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--space-12));
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.note-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.note-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  overflow-x: auto;
}

.editor-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

.editor-btn.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
}

.editor-content-area {
  flex-grow: 1;
  padding: var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.editor-title-input {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  border: none;
  background: none;
  width: 100%;
}

.editor-body-content {
  flex-grow: 1;
  font-size: var(--text-md);
  color: var(--text-primary);
  min-height: 200px;
  outline: none;
  word-break: break-word;
}

.editor-body-content[placeholder]:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
  cursor: text;
}

.note-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
