/**
 * Notes Editor Styles
 * A Notion-like block-based document editor
 */

/* ========================================
   Container Layout
   ======================================== */

.notes-container {
  display: flex;
  height: calc(100vh - var(--header-height) - 2rem);
  background: var(--content-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* ========================================
   Sidebar
   ======================================== */

.notes-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--hover-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.notes-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.notes-search-wrapper {
  flex: 1;
  position: relative;
}

.notes-search {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--content-text);
  font-size: 0.875rem;
}

.notes-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.notes-search-icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.875rem;
  pointer-events: none;
}

.notes-new-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 500;
  transition: background 0.2s;
}

.notes-new-btn:hover {
  background: var(--primary-dark);
}

/* Notes List */
.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.notes-list-empty,
.notes-loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--content-text-secondary);
  font-size: 0.875rem;
}

.notes-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.notes-list-item:hover {
  background: var(--border-color);
}

.notes-list-item.active {
  background: var(--primary-color);
  color: white;
}

.notes-list-item.active .notes-list-date {
  color: rgba(255, 255, 255, 0.7);
}

.notes-list-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.notes-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.notes-list-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-list-date {
  font-size: 0.75rem;
  color: var(--content-text-secondary);
}

.notes-list-favorite {
  color: #f59e0b;
  flex-shrink: 0;
}

.notes-list-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--content-text-secondary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}

.notes-list-item:hover .notes-list-delete {
  opacity: 1;
}

.notes-list-delete:hover {
  background: #fef2f2;
  color: #ef4444;
}

.notes-list-item.active .notes-list-delete {
  color: rgba(255, 255, 255, 0.7);
}

.notes-list-item.active .notes-list-delete:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* ========================================
   Editor Area
   ======================================== */

.notes-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Empty State */
.notes-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--content-text-secondary);
}

.notes-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.notes-empty-state h3 {
  margin: 0 0 0.5rem;
  color: var(--content-text);
  font-weight: 600;
}

.notes-empty-state p {
  margin: 0 0 1.5rem;
  max-width: 300px;
}

.notes-create-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}

.notes-create-btn:hover {
  background: var(--primary-dark);
}

/* Editor Content */
.notes-editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-editor-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.notes-icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.notes-icon-btn:hover {
  border-color: var(--primary-color);
  background: var(--hover-bg);
}

.notes-title-input {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--content-text);
  font-size: 1.5rem;
  font-weight: 600;
}

.notes-title-input:focus {
  outline: none;
}

.notes-title-input::placeholder {
  color: var(--content-text-secondary);
}

.notes-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notes-save-status {
  font-size: 0.75rem;
  color: var(--content-text-secondary);
  padding: 0 0.5rem;
}

.notes-save-status.saving {
  color: var(--primary-color);
}

.notes-save-status.saved {
  color: #10b981;
}

.notes-save-status.error {
  color: #ef4444;
}

/* Modified By */
.notes-modified-by {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--content-text-secondary);
  padding: 0 0.5rem;
  border-left: 1px solid var(--border-color);
  margin-left: 0.25rem;
}

.notes-modified-by-label {
  opacity: 0.7;
}

.notes-modified-by-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.notes-modified-by-initial {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notes-modified-by-name {
  font-weight: 500;
  color: var(--content-text);
}

.notes-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.notes-action-btn:hover {
  background: var(--hover-bg);
}

.notes-action-btn.active {
  color: #f59e0b;
}

.notes-action-btn.notes-action-danger:hover {
  background: #fef2f2;
  color: #ef4444;
}

[data-theme="dark"] .notes-action-btn.notes-action-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ========================================
   Blocks Container
   ======================================== */

.notes-blocks-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.notes-add-block {
  padding: 0.75rem 1.5rem;
  padding-left: calc(1.5rem + 80px);
  color: var(--content-text-secondary);
  font-size: 0.875rem;
  cursor: text;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.notes-add-block:hover {
  opacity: 1;
}

/* ========================================
   Block Styles
   ======================================== */

.note-block {
  display: flex;
  align-items: flex-start;
  padding: 0.25rem 1.5rem;
  position: relative;
}

.note-block.hovered .note-block-controls {
  opacity: 1;
}

.note-block-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  left: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.15s;
}

.note-block-handle,
.note-block-type-btn,
.note-block-delete-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--content-text-secondary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.15s, color 0.15s;
}

.note-block-handle {
  cursor: grab;
  letter-spacing: -2px;
}

.note-block-handle:active {
  cursor: grabbing;
}

.note-block-handle:hover,
.note-block-type-btn:hover {
  background: var(--border-color);
  color: var(--content-text);
}

.note-block-delete-btn:hover {
  background: #fef2f2;
  color: #ef4444;
}

[data-theme="dark"] .note-block-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Dragging state */
.note-block.dragging {
  opacity: 1;
}

.note-block.dragging .note-block-controls {
  opacity: 1;
}

.note-drag-container {
  pointer-events: none;
}

.note-drag-container .note-block {
  background: var(--content-bg);
}

.note-block-placeholder {
  background: var(--primary-color);
  opacity: 0.15;
  border-radius: 4px;
  margin: 0.25rem 1.5rem;
  min-height: 4px;
  transition: height 0.1s ease, opacity 0.15s ease;
}

.note-block-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  min-width: 0;
  margin-left: 80px;
}

/* Block Content */
.note-block-content {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0;
  outline: none;
  line-height: 1.6;
  color: var(--content-text);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.note-block-content:empty::before {
  content: attr(data-placeholder);
  color: var(--content-text-secondary);
  pointer-events: none;
  opacity: 0;
}

/* Only show placeholder when block is focused */
.note-block.focused .note-block-content:empty::before,
.note-block-content:focus:empty::before {
  opacity: 1;
}

/* Headings */
.note-heading1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.note-heading2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0.375rem 0;
}

.note-heading3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.25rem 0;
}

/* Lists */
.note-bullet,
.note-number {
  width: 24px;
  flex-shrink: 0;
  color: var(--content-text-secondary);
  font-size: 0.875rem;
  padding-top: 0.25rem;
}

.note-number {
  text-align: right;
  padding-right: 0.5rem;
}

/* Quote */
.note-block-quote .note-block-body {
  border-left: 3px solid var(--primary-color);
  padding-left: 1rem;
}

.note-quote-mark {
  display: none;
}

/* Divider */
.note-divider {
  width: 100%;
  height: 1px;
  border: none;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.note-block-divider {
  padding: 0.5rem 1.5rem;
}

.note-block-divider .note-block-body {
  width: 100%;
}

/* Code Block */
.note-code-block {
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem 1rem !important;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  font-size: 0.875rem;
  overflow-x: auto;
}

/* Todo */
.note-block-todo .note-block-body {
  gap: 0.5rem;
}

.note-todo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding-top: 0.25rem;
}

.note-todo-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.note-todo-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.note-todo-checkbox:checked + .note-todo-checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.note-todo-checkbox:checked + .note-todo-checkmark::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.note-block-content.checked {
  text-decoration: line-through;
  color: var(--content-text-secondary);
}

/* ========================================
   Block Type Menu
   ======================================== */

.note-block-type-menu {
  position: fixed;
  z-index: 1000;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow), 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
}

.note-type-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--content-text);
  transition: background 0.15s;
}

.note-type-option:hover {
  background: var(--hover-bg);
}

.note-type-option.selected {
  background: var(--hover-bg);
}

.note-type-option.selected:hover {
  background: var(--border-color);
}

.note-type-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--content-text-secondary);
}

/* ========================================
   Icon Picker
   ======================================== */

.note-icon-picker {
  position: fixed;
  z-index: 1000;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow), 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
  max-width: 280px;
}

.note-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.note-icon-option {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.note-icon-option:hover {
  background: var(--hover-bg);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .notes-container {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - var(--header-height) - 2rem);
  }
  
  .notes-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .notes-editor-area {
    min-height: 400px;
  }
  
  .note-block-body {
    margin-left: 60px;
  }
  
  .note-block-controls {
    left: 0;
  }
}

/* ========================================
   Links
   ======================================== */

.note-link {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-color: rgba(102, 126, 234, 0.4);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: text-decoration-color 0.15s, color 0.15s;
  border-radius: 2px;
}

.note-link:hover {
  text-decoration-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
}

/* Link Popup */
.note-link-popup {
  position: absolute;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow), 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.375rem;
  font-size: 0.875rem;
}

.note-link-popup-url {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  color: var(--content-text);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
  max-width: 280px;
}

.note-link-popup-url:hover {
  background: var(--hover-bg);
}

.note-link-popup-icon {
  flex-shrink: 0;
}

.note-link-popup-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary-color);
}

.note-link-popup-open {
  flex-shrink: 0;
  opacity: 0.5;
  font-size: 0.75rem;
}

.note-link-popup-copy,
.note-link-popup-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.note-link-popup-copy:hover {
  background: var(--hover-bg);
}

.note-link-popup-remove:hover {
  background: #fef2f2;
  color: #ef4444;
}

[data-theme="dark"] .note-link-popup-remove:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ========================================
   Images
   ======================================== */

.note-block-image {
  padding: 0.5rem 1.5rem;
}

.note-block-image .note-block-body {
  margin-left: 80px;
  width: calc(100% - 80px);
}

.note-image-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 100%;
}

.note-image {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  background: var(--hover-bg);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.note-image:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.note-image-caption {
  font-size: 0.875rem;
  color: var(--content-text-secondary);
  text-align: center;
  font-style: italic;
}

/* Drag over state */
.notes-editor-area.drag-over {
  position: relative;
}

.notes-editor-area.drag-over::after {
  content: 'Drop images here';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(102, 126, 234, 0.1);
  border: 2px dashed var(--primary-color);
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--primary-color);
  pointer-events: none;
  z-index: 10;
}

/* Image lightbox (click to enlarge) */
.note-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.note-image-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

/* ========================================
   Inline Formatting
   ======================================== */

/* Bold - browser uses <b> or <strong> */
.note-block-content b,
.note-block-content strong {
  font-weight: 600;
}

/* Italic - browser uses <i> or <em> */
.note-block-content i,
.note-block-content em {
  font-style: italic;
}

/* Underline - browser uses <u> */
.note-block-content u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Strikethrough - browser uses <strike> or <s> */
.note-block-content strike,
.note-block-content s {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Inline code */
.note-inline-code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  font-size: 0.9em;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  color: #e11d48;
}

[data-theme="dark"] .note-inline-code {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.2);
}

/* Formatting Toolbar (future enhancement) */
.note-format-toolbar {
  position: absolute;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow), 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.25rem;
}

.note-format-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--content-text);
  transition: background 0.15s;
}

.note-format-btn:hover {
  background: var(--hover-bg);
}

.note-format-btn.active {
  background: var(--primary-color);
  color: white;
}

.note-format-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 0.25rem;
}

/* ========================================
   Dark Mode Enhancements
   ======================================== */

[data-theme="dark"] .notes-container {
  background: var(--content-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .notes-sidebar {
  background: #141425;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .notes-sidebar-header {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .notes-search {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--content-text);
}

[data-theme="dark"] .notes-search:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .notes-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .notes-list-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .notes-list-item.active {
  background: var(--primary-color);
}

[data-theme="dark"] .notes-list-date {
  color: rgba(255, 255, 255, 0.5);
}

/* Editor area dark mode */
[data-theme="dark"] .notes-editor-area {
  background: var(--content-bg);
}

[data-theme="dark"] .notes-editor-header {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .notes-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .notes-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
}

[data-theme="dark"] .notes-title-input {
  color: var(--content-text);
}

[data-theme="dark"] .notes-title-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .notes-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Block controls dark mode */
[data-theme="dark"] .note-block-handle:hover,
[data-theme="dark"] .note-block-type-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--content-text);
}

[data-theme="dark"] .note-block-handle,
[data-theme="dark"] .note-block-type-btn,
[data-theme="dark"] .note-block-delete-btn {
  color: rgba(255, 255, 255, 0.4);
}

/* Code block dark mode */
[data-theme="dark"] .note-code-block {
  background: #0d0d17;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
}

/* Block quote dark mode */
[data-theme="dark"] .note-block-quote .note-block-body {
  border-left-color: var(--primary-color);
}

/* Todo checkbox dark mode */
[data-theme="dark"] .note-todo-checkmark {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
}

[data-theme="dark"] .note-todo-checkbox:checked + .note-todo-checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* Block type menu dark mode */
[data-theme="dark"] .note-block-type-menu {
  background: #1a1a2e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .note-type-option {
  color: var(--content-text);
}

[data-theme="dark"] .note-type-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .note-type-option.selected {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .note-type-option.selected:hover {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .note-type-icon {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

/* Icon picker dark mode */
[data-theme="dark"] .note-icon-picker {
  background: #1a1a2e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .note-icon-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Link popup dark mode */
[data-theme="dark"] .note-link-popup {
  background: #1a1a2e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .note-link-popup-url {
  color: var(--content-text);
}

[data-theme="dark"] .note-link-popup-url:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .note-link-popup-copy:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Format toolbar dark mode */
[data-theme="dark"] .note-format-toolbar {
  background: #1a1a2e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .note-format-btn {
  color: var(--content-text);
}

[data-theme="dark"] .note-format-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Divider dark mode */
[data-theme="dark"] .note-divider {
  background: rgba(255, 255, 255, 0.1);
}

/* Image dark mode */
[data-theme="dark"] .note-image {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .note-image:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Drag over state dark mode */
[data-theme="dark"] .notes-editor-area.drag-over::after {
  background: rgba(102, 126, 234, 0.15);
}

/* Block placeholder dark mode */
[data-theme="dark"] .note-block-placeholder {
  background: var(--primary-color);
  opacity: 0.2;
}

/* Empty state dark mode */
[data-theme="dark"] .notes-empty-state {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .notes-empty-state h3 {
  color: var(--content-text);
}

[data-theme="dark"] .notes-empty-icon {
  opacity: 0.4;
}

/* Add block hint dark mode */
[data-theme="dark"] .notes-add-block {
  color: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .notes-add-block:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* Scrollbar dark mode */
[data-theme="dark"] .notes-list::-webkit-scrollbar,
[data-theme="dark"] .notes-blocks-container::-webkit-scrollbar {
  width: 8px;
}

[data-theme="dark"] .notes-list::-webkit-scrollbar-track,
[data-theme="dark"] .notes-blocks-container::-webkit-scrollbar-track {
  background: transparent;
}

[data-theme="dark"] .notes-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .notes-blocks-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

[data-theme="dark"] .notes-list::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .notes-blocks-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Heading colors dark mode */
[data-theme="dark"] .note-heading1,
[data-theme="dark"] .note-heading2,
[data-theme="dark"] .note-heading3 {
  color: var(--content-text);
}

/* List markers dark mode */
[data-theme="dark"] .note-bullet,
[data-theme="dark"] .note-number {
  color: rgba(255, 255, 255, 0.4);
}

/* Link dark mode */
[data-theme="dark"] .note-link {
  color: #818cf8;
  text-decoration-color: rgba(129, 140, 248, 0.4);
}

[data-theme="dark"] .note-link:hover {
  text-decoration-color: #818cf8;
  background: rgba(129, 140, 248, 0.15);
}

/* Checked todo dark mode */
[data-theme="dark"] .note-block-content.checked {
  color: rgba(255, 255, 255, 0.4);
}

/* Selection/highlight dark mode */
[data-theme="dark"] .note-block-content::selection {
  background: rgba(102, 126, 234, 0.3);
}

/* Focus states dark mode */
[data-theme="dark"] .note-block.focused .note-block-content {
  outline: none;
}

/* Save status colors (same in both modes but ensuring visibility) */
[data-theme="dark"] .notes-save-status {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .notes-save-status.saving {
  color: #818cf8;
}

[data-theme="dark"] .notes-save-status.saved {
  color: #34d399;
}

[data-theme="dark"] .notes-save-status.error {
  color: #f87171;
}

/* Modified by dark mode */
[data-theme="dark"] .notes-modified-by {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .notes-modified-by-name {
  color: rgba(255, 255, 255, 0.8);
}

/* Favorite button dark mode */
[data-theme="dark"] .notes-action-btn.active {
  color: #fbbf24;
}

/* Loading/empty states dark mode */
[data-theme="dark"] .notes-loading {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .notes-list-empty {
  color: rgba(255, 255, 255, 0.4);
}

/* Drag ghost dark mode */
[data-theme="dark"] .note-drag-container .note-block {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Image caption dark mode */
[data-theme="dark"] .note-image-caption {
  color: rgba(255, 255, 255, 0.5);
}

/* New note button dark mode */
[data-theme="dark"] .notes-new-btn {
  background: var(--primary-color);
}

[data-theme="dark"] .notes-new-btn:hover {
  background: #7c8df0;
}

/* Create button dark mode */
[data-theme="dark"] .notes-create-btn {
  background: var(--primary-color);
}

[data-theme="dark"] .notes-create-btn:hover {
  background: #7c8df0;
}

/* Lightbox refinement */
[data-theme="dark"] .note-image-lightbox {
  background: rgba(0, 0, 0, 0.95);
}

/* Block content placeholder dark mode */
[data-theme="dark"] .note-block-content:empty::before {
  color: rgba(255, 255, 255, 0.3);
}

/* Quote text styling dark mode */
[data-theme="dark"] .note-block-quote .note-block-content {
  color: rgba(255, 255, 255, 0.8);
}

/* New note button icon */
[data-theme="dark"] .notes-new-btn span {
  color: white;
}

/* Sidebar list items - non-active state */
[data-theme="dark"] .notes-list-item {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .notes-list-item .notes-list-icon {
  opacity: 0.7;
}

[data-theme="dark"] .notes-list-item .notes-list-title {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .notes-list-item .notes-list-date {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .notes-list-item.active .notes-list-title,
[data-theme="dark"] .notes-list-item.active .notes-list-icon {
  color: white;
  opacity: 1;
}

/* Delete button in list dark mode */
[data-theme="dark"] .notes-list-delete {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .notes-list-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

[data-theme="dark"] .notes-list-item.active .notes-list-delete {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .notes-list-item.active .notes-list-delete:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Action buttons in header - star, delete */
[data-theme="dark"] .notes-action-btn {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .notes-action-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .notes-action-btn.active {
  color: #fbbf24;
}

/* Icon button (the note icon in header) */
[data-theme="dark"] .notes-icon-btn {
  color: rgba(255, 255, 255, 0.7);
}

/* Numbered list - make numbers more visible */
[data-theme="dark"] .note-number {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .note-bullet {
  color: rgba(255, 255, 255, 0.5);
}

/* Add block placeholder - more visible */
[data-theme="dark"] .notes-add-block {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .notes-add-block:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Search icon */
[data-theme="dark"] .notes-search-icon {
  opacity: 0.5;
}

/* Favorite star in list */
[data-theme="dark"] .notes-list-favorite {
  color: #fbbf24;
}
