/* Smart folder context menu */
.smart-folder-context-menu {
    position: fixed;
    z-index: calc(var(--z-layer-sheet) + 100);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    padding: 4px;
    min-width: 140px;
}

.smart-folder-context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm, 6px);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: 'Avenir Next', -apple-system, sans-serif;
    transition: background var(--transition-fast);
}

.smart-folder-context-menu-item:hover {
    background: var(--bg-hover);
}

.smart-folder-context-menu-item.destructive {
    color: var(--color-red-text);
}

.smart-folder-context-menu-item.destructive:hover {
    background: rgba(239, 68, 68, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .smart-folder-modal-overlay,
    .smart-folder-modal {
        animation: none;
    }
}

.notes-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notes-panel-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.notes-area-group {
    margin-bottom: var(--space-2);
}

.notes-area-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    transition: max-height var(--duration-normal) var(--ease-in-out),
                opacity var(--duration-normal) var(--ease-in-out),
                margin var(--duration-normal) var(--ease-in-out);
}

.notes-area-group.collapsed .notes-area-list {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

/* Unfiled notes - flat list at bottom without folder wrapper */
.notes-unfiled-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-light);
}

.notes-area-group.collapsed .area-chevron {
    transform: rotate(-90deg);
}

.notes-area-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-radius: var(--radius-sm);
    margin: 0 4px;
}

.notes-area-header:hover {
    background: var(--bg-hover);
}

.notes-area-header .area-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-area-header .area-icon svg {
    color: white;
}

.notes-area-header .area-icon.no-area {
    background: var(--bg-tertiary);
}

.notes-area-header .area-icon.no-area svg {
    color: var(--text-tertiary);
}

.notes-area-header .area-icon.pinned-icon {
    background: var(--accent-blue-light);
}

.notes-area-header .area-icon.pinned-icon svg {
    color: var(--accent-blue);
}

.notes-area-header .area-name {
    flex: 1;
}

.notes-area-header .area-count {
    font-weight: normal;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: var(--space-half) var(--space-1-5);
    border-radius: var(--radius-md);
}

/* Notes sidebar section header (Areas) */
.notes-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-3) var(--space-1);
    font-size: var(--font-size-2xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--space-2);
    border-top: 1px solid var(--border-light);
}

.notes-section-header .section-add-btn {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-circle);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: var(--font-size-14);
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.notes-section-header .section-add-btn:hover {
    background: var(--accent-fill);
    color: white;
}

/* Notes area delete button */
.notes-area-delete-btn {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: auto;
}

.notes-area-header:hover .notes-area-delete-btn {
    opacity: 1;
}

.notes-area-delete-btn:hover {
    background: var(--accent-red-light);
    color: var(--color-red-text);
}

.notes-area-delete-btn svg {
    width: 12px;
    height: 12px;
}

.notes-panel-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 12px 6px 38px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.notes-panel-item:hover,
.notes-panel-item.active {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.note-icon {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.notes-panel-item:hover .note-icon,
.notes-panel-item.active .note-icon {
    color: var(--accent-blue);
}

.note-item-name {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-main-content {
    flex: 1;
    min-width: 0;
    padding: 16px 24px;
    overflow-y: auto;
    background: var(--bg-secondary);
    max-height: calc(100vh - 120px); /* Force scrollable area */
    scrollbar-width: none;
}

.notes-main-content::-webkit-scrollbar {
    display: none;
}

.notes-main-content .notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.notes-main-content .notes-list.directory-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Smart Filters */
.notes-smart-filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.notes-filter-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

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

.notes-filter-item.active {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.notes-filter-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.notes-filter-item span {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.filter-count {
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    min-width: 20px;
    text-align: right;
}

.notes-filter-item.active .filter-count {
    color: var(--accent-blue);
}

/* Folders Section */
.notes-folders-section {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) 0;
}

.notes-folders-group {
    margin-bottom: var(--space-6);
}

.notes-folders-header {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
}

.notes-folders-list {
    display: flex;
    flex-direction: column;
}

.notes-folder-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.notes-folder-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notes-folder-item.active {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    font-weight: 500;
}

.notes-folder-item .folder-arrow {
    font-size: var(--font-size-2xs);
    color: var(--text-tertiary);
    width: 12px;
}

.notes-folder-item .folder-name {
    font-size: var(--font-size-sm);
    font-weight: inherit;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-folder-item .folder-count {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    min-width: 20px;
    text-align: right;
}
